From 716cc530b6c5c50ffb64db64b804b40677458e1d Mon Sep 17 00:00:00 2001 From: pdontthink Date: Mon, 26 Mar 2007 17:39:43 +0000 Subject: [PATCH] Revert last change, which caused nasty sesion ID errors, although now we still have a problem wherein other cookies that are intentionally set to an empty string are revalued as 'deleted', and the caller may not expect such git-svn-id: https://svn.code.sf.net/p/squirrelmail/code/trunk/squirrelmail@12350 7612ce4b-ef26-0410-bec9-ea0150e637f0 --- functions/global.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/functions/global.php b/functions/global.php index b88311fd..5fe112a4 100644 --- a/functions/global.php +++ b/functions/global.php @@ -324,7 +324,7 @@ function sqsession_destroy() { * merging of sessions. */ - global $base_uri; + global $base_uri, $_COOKIE, $_SESSION; if (isset($_COOKIE[session_name()]) && session_name()) sqsetcookie(session_name(), '', 0, $base_uri); if (isset($_COOKIE['username']) && $_COOKIE['username']) sqsetcookie('username','',0,$base_uri); @@ -378,7 +378,7 @@ function sqsession_start() { * @param boolean $bHttpOnly Disallow JS to access the cookie (IE6 only) * @return void */ -function sqsetcookie($sName,$sValue='',$iExpire=0,$sPath="",$sDomain="",$bSecure=false,$bHttpOnly=true) { +function sqsetcookie($sName,$sValue='deleted',$iExpire=0,$sPath="",$sDomain="",$bSecure=false,$bHttpOnly=true) { // if we have a secure connection then limit the cookies to https only. if ($sName && isset($_SERVER['HTTPS']) && $_SERVER['HTTPS']) { $bSecure = true; @@ -403,7 +403,7 @@ function sqsetcookie($sName,$sValue='',$iExpire=0,$sPath="",$sDomain="",$bSecure $Port = strpos($Domain, ':'); if ($Port !== false) $Domain = substr($Domain, 0, $Port); } - if (!$sValue) $sValue = ''; + if (!$sValue) $sValue = 'deleted'; header('Set-Cookie: ' . rawurlencode($sName) . '=' . rawurlencode($sValue) . (empty($iExpires) ? '' : '; expires=' . gmdate('D, d-M-Y H:i:s', $iExpires) . ' GMT') . (empty($sPath) ? '' : '; path=' . $sPath) -- 2.25.1