From bfed32eb78b6c720b16bc7ed60153fd2fe257a9e Mon Sep 17 00:00:00 2001 From: =?utf8?q?Gerg=C5=91=20Tisza?= Date: Thu, 21 Jan 2016 04:24:43 -0800 Subject: [PATCH] Do not raise a PHP warning when session write fails Bug: T124126 Change-Id: I3482d8dba4a4d9fe92a39439df41c0e70bfef35d --- includes/session/PHPSessionHandler.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/includes/session/PHPSessionHandler.php b/includes/session/PHPSessionHandler.php index 44d14cd009..53443211f0 100644 --- a/includes/session/PHPSessionHandler.php +++ b/includes/session/PHPSessionHandler.php @@ -238,10 +238,12 @@ class PHPSessionHandler { $session = $this->manager->getSessionById( $id, true ); if ( !$session ) { + // This can happen under normal circumstances, if the session exists but is + // invalid. Let's emit a log warning instead of a PHP warning. $this->logger->warning( __METHOD__ . ": Session \"$id\" cannot be loaded, skipping write." ); - return false; + return true; } // First, decode the string PHP handed us -- 2.20.1