// 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' ) ) {
throw $ex;
}
+ if ( $session->isPersistent() ) {
+ $wgInitialSessionId = $session->getSessionId();
+ }
+
$session->renew();
if ( MediaWiki\Session\PHPSessionHandler::isEnabled() &&
( $session->isPersistent() || $session->shouldRememberUser() )