Merge "SpecialWatchlist: Display actual number of days for the "all" option"
[lhc/web/wiklou.git] / includes / Setup.php
index e962a49..9bf05e0 100644 (file)
@@ -691,6 +691,11 @@ if ( !is_object( $wgAuth ) ) {
 
 // Set up the session
 $ps_session = Profiler::instance()->scopedProfileIn( $fname . '-session' );
+/**
+ * @var MediaWiki\\Session\\SessionId|null $wgInitialSessionId The persistent
+ * session ID (if any) loaded at startup
+ */
+$wgInitialSessionId = null;
 if ( !defined( 'MW_NO_SESSION' ) && !$wgCommandLineMode ) {
        // If session.auto_start is there, we can't touch session name
        if ( $wgPHPSessionHandling !== 'disable' && !wfIniGetBool( 'session.auto_start' ) ) {
@@ -723,12 +728,17 @@ if ( !defined( 'MW_NO_SESSION' ) && !$wgCommandLineMode ) {
                throw $ex;
        }
 
+       if ( $session->isPersistent() ) {
+               $wgInitialSessionId = $session->getSessionId();
+       }
+
        $session->renew();
        if ( MediaWiki\Session\PHPSessionHandler::isEnabled() &&
                ( $session->isPersistent() || $session->shouldRememberUser() )
        ) {
                // Start the PHP-session for backwards compatibility
                session_id( $session->getId() );
+               MediaWiki\quietCall( 'session_cache_limiter', 'private, must-revalidate' );
                MediaWiki\quietCall( 'session_start' );
        }
 }