Do not raise a PHP warning when session write fails
authorGergő Tisza <tgr.huwiki@gmail.com>
Thu, 21 Jan 2016 12:24:43 +0000 (04:24 -0800)
committerGergő Tisza <tgr.huwiki@gmail.com>
Thu, 21 Jan 2016 12:24:43 +0000 (04:24 -0800)
Bug: T124126
Change-Id: I3482d8dba4a4d9fe92a39439df41c0e70bfef35d

includes/session/PHPSessionHandler.php

index 44d14cd..5344321 100644 (file)
@@ -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