X-Git-Url: http://git.cyclocoop.org/?a=blobdiff_plain;f=includes%2Fsession%2FSessionManager.php;h=40a568ffa7b75cefa7863264956e648b49a415fc;hb=059fdf444ebc254fe703d36c98397164b5dbd533;hp=0041450f86540b0a0343867f3d91292dff7c74d2;hpb=e968a1f431ad058dcb14adb2757bde5664b99a79;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/session/SessionManager.php b/includes/session/SessionManager.php index 0041450f86..40a568ffa7 100644 --- a/includes/session/SessionManager.php +++ b/includes/session/SessionManager.php @@ -214,7 +214,7 @@ final class SessionManager implements SessionManagerInterface { } // Test if the session is in storage, and if so try to load it. - $key = wfMemcKey( 'MWSession', $id ); + $key = $this->store->makeKey( 'MWSession', $id ); if ( is_array( $this->store->get( $key ) ) ) { $create = false; // If loading fails, don't bother creating because it probably will fail too. if ( $this->loadSessionInfoFromStore( $info, $request ) ) { @@ -255,7 +255,7 @@ final class SessionManager implements SessionManagerInterface { throw new \InvalidArgumentException( 'Invalid session ID' ); } - $key = wfMemcKey( 'MWSession', $id ); + $key = $this->store->makeKey( 'MWSession', $id ); if ( is_array( $this->store->get( $key ) ) ) { throw new \InvalidArgumentException( 'Session ID already exists' ); } @@ -545,7 +545,7 @@ final class SessionManager implements SessionManagerInterface { * @return bool Whether the session info matches the stored data (if any) */ private function loadSessionInfoFromStore( SessionInfo &$info, WebRequest $request ) { - $key = wfMemcKey( 'MWSession', $info->getId() ); + $key = $this->store->makeKey( 'MWSession', $info->getId() ); $blob = $this->store->get( $key ); // If we got data from the store and the SessionInfo says to force use, @@ -773,7 +773,8 @@ final class SessionManager implements SessionManagerInterface { return $failHandler(); } } elseif ( !$info->getUserInfo()->isVerified() ) { - $this->logger->warning( + // probably just a session timeout + $this->logger->info( 'Session "{session}": Unverified user provided and no metadata to auth it', [ 'session' => $info, @@ -933,7 +934,7 @@ final class SessionManager implements SessionManagerInterface { public function generateSessionId() { do { $id = \Wikimedia\base_convert( \MWCryptRand::generateHex( 40 ), 16, 32, 32 ); - $key = wfMemcKey( 'MWSession', $id ); + $key = $this->store->makeKey( 'MWSession', $id ); } while ( isset( $this->allSessionIds[$id] ) || is_array( $this->store->get( $key ) ) ); return $id; }