From 664ba620e97613f79847a822ac83074402b27a2c Mon Sep 17 00:00:00 2001 From: =?utf8?q?Gerg=C5=91=20Tisza?= Date: Wed, 2 Mar 2016 15:36:02 -0800 Subject: [PATCH] Prevent "Failed to create..." warnings when session loading fails If there is an existing session for a given ID but loading it fails, there is no point in trying to create a new empty session with that ID. Just fail silently (the reason for not loading the session should be logged elsewhere), don't spam the logs and don't slow down execution by throwing and catching an exception. Change-Id: I8299872cc29c32cb245686ed0bca6b9a5902cdc1 --- includes/session/SessionManager.php | 1 + 1 file changed, 1 insertion(+) diff --git a/includes/session/SessionManager.php b/includes/session/SessionManager.php index 58f995fac7..81f82439e2 100644 --- a/includes/session/SessionManager.php +++ b/includes/session/SessionManager.php @@ -202,6 +202,7 @@ final class SessionManager implements SessionManagerInterface { // of "no such ID" $key = wfMemcKey( 'MWSession', $id ); if ( is_array( $this->store->get( $key ) ) ) { + $create = false; $info = new SessionInfo( SessionInfo::MIN_PRIORITY, [ 'id' => $id, 'idIsSafe' => true ] ); if ( $this->loadSessionInfoFromStore( $info, $request ) ) { $session = $this->getSessionFromInfo( $info, $request ); -- 2.20.1