r49370 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r49369‎ | r49370 | r49371 >
Date:14:53, 10 April 2009
Author:demon
Status:ok
Tags:
Comment:
(bugs 11381, 11613) Session.save_handler issues:
* Added a new config variable, $wgSessionHandler to control what value the save_handler is set to
* Setting to null allows you to disable setting it entirely, which was the primary complaint of the two bugs, but it also allows you to set it to whatever you'd like
Modified paths:
  • /trunk/phase3/RELEASE-NOTES (modified) (history)
  • /trunk/phase3/includes/DefaultSettings.php (modified) (history)
  • /trunk/phase3/includes/GlobalFunctions.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/GlobalFunctions.php
@@ -2708,13 +2708,14 @@
27092709 * Initialise php session
27102710 */
27112711 function wfSetupSession() {
2712 - global $wgSessionsInMemcached, $wgCookiePath, $wgCookieDomain, $wgCookieSecure, $wgCookieHttpOnly;
 2712+ global $wgSessionsInMemcached, $wgCookiePath, $wgCookieDomain,
 2713+ $wgCookieSecure, $wgCookieHttpOnly, $wgSessionHandler;
27132714 if( $wgSessionsInMemcached ) {
27142715 require_once( 'MemcachedSessions.php' );
2715 - } elseif( 'files' != ini_get( 'session.save_handler' ) ) {
2716 - # If it's left on 'user' or another setting from another
2717 - # application, it will end up failing. Try to recover.
2718 - ini_set ( 'session.save_handler', 'files' );
 2716+ } elseif( $wgSessionHandler && $wgSessionHandler != ini_get( 'session.save_handler' ) ) {
 2717+ # Only set this if $wgSessionHandler isn't null and session.save_handler
 2718+ # hasn't already been set to the desired value (that causes errors)
 2719+ ini_set ( 'session.save_handler', $wgSessionHandler );
27192720 }
27202721 $httpOnlySafe = wfHttpOnlySafe();
27212722 wfDebugLog( 'cookie',
Index: trunk/phase3/includes/DefaultSettings.php
@@ -736,6 +736,12 @@
737737
738738 $wgSessionsInMemcached = false;
739739
 740+/** This is used for setting php's session.save_handler. In practice, you will
 741+ * almost never need to change this ever. Other options might be 'user' or
 742+ * 'session_mysql.' Setting to null skips setting this entirely (which might be
 743+ * useful if you're doing cross-application sessions, see bug 11381) */
 744+$wgSessionHandler = 'files';
 745+
740746 /**@{
741747 * Memcached-specific settings
742748 * See docs/memcached.txt
Index: trunk/phase3/RELEASE-NOTES
@@ -31,6 +31,7 @@
3232 * Add $wgExportFromNamespaces for enabling/disabling the "export all from
3333 namespace" option (disabled by default)
3434 * (bug 18222) $wgMinimalPasswordLength default is now 1
 35+* $wgSessionHandler can be used to configure session.save_handler
3536
3637 === New features in 1.15 ===
3738
@@ -335,6 +336,8 @@
336337 * (bug 12998) Allow <sup>, <sub>, etc. in DISPLAYTITLE
337338 * (bug 1553) Lowercase navigation headings in German
338339 * (bug 7830) Pending transactions failed to commit on loginToUse() error
 340+* (bug 11613) session.save_handler being over-ridden
 341+* (bug 11381) session.save_handler being set twice (causes error)
339342
340343 == API changes in 1.15 ==
341344 * (bug 16858) Revamped list=deletedrevs to make listing deleted contributions

Follow-up revisions

RevisionCommit summaryAuthorDate
r92124(bug 26360) $wgSessionHandler was overriding system settings unconditionally....demon23:26, 13 July 2011

Status & tagging log