session: Add debug message for the used store class
[lhc/web/wiklou.git] / includes / session / SessionManager.php
index 1da0ceb..79193d6 100644 (file)
@@ -177,6 +177,7 @@ final class SessionManager implements SessionManagerInterface {
                } else {
                        $store = \ObjectCache::getInstance( $this->config->get( 'SessionCacheType' ) );
                }
+               $this->logger->debug( 'SessionManager using store ' . get_class( $store ) );
                $this->store = $store instanceof CachedBagOStuff ? $store : new CachedBagOStuff( $store );
 
                register_shutdown_function( [ $this, 'shutdown' ] );
@@ -286,7 +287,6 @@ final class SessionManager implements SessionManagerInterface {
                                        "$provider returned empty session info with id flagged unsafe"
                                );
                        }
-                       // @phan-suppress-next-line PhanTypeInvalidDimOffset
                        $compare = $infos ? SessionInfo::compare( $infos[0], $info ) : -1;
                        if ( $compare > 0 ) {
                                continue;
@@ -506,11 +506,10 @@ final class SessionManager implements SessionManagerInterface {
                }
 
                if ( count( $retInfos ) > 1 ) {
-                       $ex = new \OverflowException(
+                       throw new SessionOverflowException(
+                               $retInfos,
                                'Multiple sessions for this request tied for top priority: ' . implode( ', ', $retInfos )
                        );
-                       $ex->sessionInfos = $retInfos;
-                       throw $ex;
                }
 
                return $retInfos ? $retInfos[0] : null;