From: Alexandre Emsenhuber Date: Mon, 4 Aug 2014 19:51:58 +0000 (+0200) Subject: Don't set the session name in CLI or when sessions are deactivated X-Git-Tag: 1.31.0-rc.0~14438^2 X-Git-Url: http://git.cyclocoop.org/%24self?a=commitdiff_plain;h=e71939297e5cc23a13ffdb6eefb7441d6d51b9c1;p=lhc%2Fweb%2Fwiklou.git 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 --- diff --git a/includes/Setup.php b/includes/Setup.php index 03c529e5e0..3a41c05c18 100644 --- a/includes/Setup.php +++ b/includes/Setup.php @@ -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' );