Don't set the session name in CLI or when sessions are deactivated

It doesn't make much sense to set the session name in that case.

Change-Id: I4cf237d79061d146091c3409b7ac3e19136f3fb6
This commit is contained in:
Alexandre Emsenhuber 2014-08-04 21:51:58 +02:00
parent cefa3c4941
commit e71939297e

View file

@ -558,15 +558,15 @@ wfRunHooks( 'SetupAfterCache' );
wfProfileIn( $fname . '-session' );
// If session.auto_start is there, we can't touch session name
if ( !wfIniGetBool( 'session.auto_start' ) ) {
session_name( $wgSessionName ? $wgSessionName : $wgCookiePrefix . '_session' );
}
if ( !defined( 'MW_NO_SESSION' ) && !$wgCommandLineMode ) {
// If session.auto_start is there, we can't touch session name
if ( !wfIniGetBool( 'session.auto_start' ) ) {
session_name( $wgSessionName ? $wgSessionName : $wgCookiePrefix . '_session' );
}
if ( !defined( 'MW_NO_SESSION' ) && !$wgCommandLineMode &&
( $wgRequest->checkSessionCookie() || isset( $_COOKIE[$wgCookiePrefix . 'Token'] ) )
) {
wfSetupSession();
if ( $wgRequest->checkSessionCookie() || isset( $_COOKIE[$wgCookiePrefix . 'Token'] ) ) {
wfSetupSession();
}
}
wfProfileOut( $fname . '-session' );