X-Git-Url: http://git.cyclocoop.org/?a=blobdiff_plain;f=includes%2Fsession%2FPHPSessionHandler.php;h=f14e0eb7409d61c7bf36e906bb807fde6d58d4e5;hb=f79c9e6ca3c02090d6d56eaecb2ab90d4198b2b9;hp=d029163900fc4ba7fd688201c330af5fb57e4eb4;hpb=a93cf8f4eee40a448bcd99b8fe1c32dc80775b6b;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/session/PHPSessionHandler.php b/includes/session/PHPSessionHandler.php index d029163900..f14e0eb740 100644 --- a/includes/session/PHPSessionHandler.php +++ b/includes/session/PHPSessionHandler.php @@ -37,6 +37,8 @@ class PHPSessionHandler implements \SessionHandlerInterface { /** @var bool Whether PHP session handling is enabled */ protected $enable = false; + + /** @var bool */ protected $warn = true; /** @var SessionManager|null */ @@ -122,22 +124,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 ); + 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( '' ); + // 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(); + // 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 ); + // Register this as the save handler, and register an appropriate + // shutdown function. + session_set_save_handler( self::$instance, true ); + } finally { + \Wikimedia\restoreWarnings(); + } } /**