X-Git-Url: http://git.heureux-cyclage.org/?a=blobdiff_plain;f=includes%2Fsession%2FPHPSessionHandler.php;h=157cc52ff2362809a3d2018c92ad897dc3e3fb9c;hb=701854b3ebc3c2b06067823395a7d95e8984cfda;hp=d029163900fc4ba7fd688201c330af5fb57e4eb4;hpb=5a6c78c441e9d977bb33a0eb4536d5a3c5067943;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/session/PHPSessionHandler.php b/includes/session/PHPSessionHandler.php index d029163900..157cc52ff2 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(); + } } /**