X-Git-Url: https://git.heureux-cyclage.org/?p=lhc%2Fweb%2Fwiklou.git;a=blobdiff_plain;f=includes%2Fsession%2FPHPSessionHandler.php;h=e1415df4d9603be80c14d786df3f22805bc6004d;hp=084ac05c96070c7f9975d735a5ca5f2ca64fafe9;hb=43ee1abaca625261f5caae501bf9b10b54bc2e30;hpb=2fdcd7bfdd95a3b1515b9a94289d67eb60add484 diff --git a/includes/session/PHPSessionHandler.php b/includes/session/PHPSessionHandler.php index 084ac05c96..e1415df4d9 100644 --- a/includes/session/PHPSessionHandler.php +++ b/includes/session/PHPSessionHandler.php @@ -122,22 +122,28 @@ class PHPSessionHandler implements \SessionHandlerInterface { // Close any auto-started session, before we replace it session_write_close(); - // Tell PHP not to mess with cookies itself - ini_set( 'session.use_cookies', 0 ); - ini_set( 'session.use_trans_sid', 0 ); - - // T124510: Disable automatic PHP session related cache headers. - // MediaWiki adds it's own headers and the default PHP behavior may - // set headers such as 'Pragma: no-cache' that cause problems with - // some user agents. - session_cache_limiter( '' ); - - // Also set a sane serialization handler - \Wikimedia\PhpSessionSerializer::setSerializeHandler(); - - // Register this as the save handler, and register an appropriate - // shutdown function. - session_set_save_handler( self::$instance, true ); + try { + \Wikimedia\suppressWarnings(); + + // Tell PHP not to mess with cookies itself + ini_set( 'session.use_cookies', 0 ); + ini_set( 'session.use_trans_sid', 0 ); + + // T124510: Disable automatic PHP session related cache headers. + // MediaWiki adds it's own headers and the default PHP behavior may + // set headers such as 'Pragma: no-cache' that cause problems with + // some user agents. + session_cache_limiter( '' ); + + // Also set a sane serialization handler + \Wikimedia\PhpSessionSerializer::setSerializeHandler(); + + // Register this as the save handler, and register an appropriate + // shutdown function. + session_set_save_handler( self::$instance, true ); + } finally { + \Wikimedia\restoreWarnings(); + } } /** @@ -145,7 +151,7 @@ class PHPSessionHandler implements \SessionHandlerInterface { * @private Use self::install(). * @param SessionManager $manager * @param BagOStuff $store - * @param LoggerInterface $store + * @param LoggerInterface $logger */ public function setManager( SessionManager $manager, BagOStuff $store, LoggerInterface $logger