X-Git-Url: https://git.heureux-cyclage.org/?p=lhc%2Fweb%2Fwiklou.git;a=blobdiff_plain;f=includes%2Fsession%2FPHPSessionHandler.php;h=e1415df4d9603be80c14d786df3f22805bc6004d;hp=b76f0ff6b70f6a17ebac69fd671df9a1cd294b61;hb=43ee1abaca625261f5caae501bf9b10b54bc2e30;hpb=3f59cb9f3a53ad28f8a95fe299c5de6abd24b453 diff --git a/includes/session/PHPSessionHandler.php b/includes/session/PHPSessionHandler.php index b76f0ff6b7..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(); + } } /**