From 88ba444d0dbe61afe3179c0aee3ea52831109e0b Mon Sep 17 00:00:00 2001 From: Chad Horohoe Date: Mon, 18 Aug 2008 19:57:01 +0000 Subject: [PATCH] Remove boneheaded config var $wgEnablePersistentCookies. Setting the default expiration to 0 now makes the cookies session-only (seeing as it was largely ignored) --- RELEASE-NOTES | 2 -- includes/DefaultSettings.php | 8 +++----- includes/WebResponse.php | 6 +----- 3 files changed, 4 insertions(+), 12 deletions(-) diff --git a/RELEASE-NOTES b/RELEASE-NOTES index 20784439f0..c081abf7e6 100644 --- a/RELEASE-NOTES +++ b/RELEASE-NOTES @@ -34,8 +34,6 @@ it from source control: http://www.mediawiki.org/wiki/Download_from_SVN $wgAddGroups and $wgRemoveGroups, where the user must belong to a specified group in order to add or remove those groups from themselves. Backwards compatibility is maintained. -* $wgEnablePersistentCookies has been added. Setting to false disables the - setting of persistent cookies. Defaults to true. * $wgRestrictDisplayTitle controls if the use of the {{DISPLAYTITLE}} magic word is restricted to titles equivalent to the actual page title. This is true per default, but can be set to false to allow any title. diff --git a/includes/DefaultSettings.php b/includes/DefaultSettings.php index 692e1ff802..020c1afa3d 100644 --- a/includes/DefaultSettings.php +++ b/includes/DefaultSettings.php @@ -1470,6 +1470,9 @@ $wgRCChangedSizeThreshold = -500; * view for watched pages with new changes */ $wgShowUpdatedMarker = true; +/** + * Default cookie expiration time. Setting to 0 disables makes all cookies session-only. + */ $wgCookieExpiration = 30*86400; /** Clock skew or the one-second resolution of time() can occasionally cause cache @@ -1556,11 +1559,6 @@ $wgCookiePrefix = false; */ $wgCookieHttpOnly = version_compare("5.2", PHP_VERSION, "<"); -/** - * Allow MediaWiki to set persistent cookies for login, etc. - */ -$wgEnablePersistentCookies = true; - /** * If the requesting browser matches a regex in this blacklist, we won't * send it cookies with HttpOnly mode, even if $wgCookieHttpOnly is on. diff --git a/includes/WebResponse.php b/includes/WebResponse.php index 5ebc699764..b667e9ff02 100644 --- a/includes/WebResponse.php +++ b/includes/WebResponse.php @@ -12,13 +12,9 @@ class WebResponse { /** Set the browser cookie */ function setcookie( $name, $value, $expire = 0 ) { - global $wgEnablePersistentCookies; - if ( !$wgEnablePersistentCookies ) { - return false; - } global $wgCookiePath, $wgCookiePrefix, $wgCookieDomain; global $wgCookieSecure,$wgCookieExpiration, $wgCookieHttpOnly; - if( $expire == 0 ) { + if ( $expire == 0 ) { $expire = time() + $wgCookieExpiration; } $httpOnlySafe = wfHttpOnlySafe(); -- 2.20.1