Patch by Ivan Krstic, slightly modified, for the session handler wrong setting problem.
authorBrion Vibber <brion@users.mediawiki.org>
Tue, 24 Aug 2004 03:10:51 +0000 (03:10 +0000)
committerBrion Vibber <brion@users.mediawiki.org>
Tue, 24 Aug 2004 03:10:51 +0000 (03:10 +0000)
Bug 179: Detect when session.save_handler set incorrectly
http://bugzilla.wikipedia.org/show_bug.cgi?id=179

includes/User.php

index 578a7ee..294923d 100644 (file)
@@ -155,6 +155,10 @@ class User {
                global $wgSessionsInMemcached, $wgCookiePath, $wgCookieDomain;
                if( $wgSessionsInMemcached ) {
                        require_once( 'MemcachedSessions.php' );
+               } elseif( 'files' != ini_get( 'session.save_handler' ) ) {
+                       # If it's left on 'user' or another setting from another
+                       # application, it will end up failing. Try to recover.
+                       ini_set ( 'session.save_handler', 'files' );
                }
                session_set_cookie_params( 0, $wgCookiePath, $wgCookieDomain );
                session_cache_limiter( 'private, must-revalidate' );