From: stekkel Date: Sat, 13 Jan 2007 15:07:56 +0000 (+0000) Subject: Stop warning about invalid session_id X-Git-Url: https://vcs.fsf.org/?p=squirrelmail.git;a=commitdiff_plain;h=9e56668f860cae2e1b6ad36c5bcd3f3e925c5d57;hp=68a7e1d68ec5682e3fca1d3703476d824996909a Stop warning about invalid session_id git-svn-id: https://svn.code.sf.net/p/squirrelmail/code/trunk/squirrelmail@12120 7612ce4b-ef26-0410-bec9-ea0150e637f0 --- diff --git a/functions/global.php b/functions/global.php index 1d252e2a..749ed394 100644 --- a/functions/global.php +++ b/functions/global.php @@ -365,8 +365,7 @@ function sqsession_start() { // session_starts sets the sessionid cookie buth without the httponly var // setting the cookie again sets the httponly cookie attribute - - sqsetcookie(session_name(),session_id(),false,$base_uri); + sqsetcookie(session_name(),$session_id,false,$base_uri); } @@ -381,7 +380,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; @@ -400,7 +399,7 @@ function sqsetcookie($sName,$sValue="",$iExpire=0,$sPath="",$sDomain="",$bSecure $Port = strpos($Domain, ':'); if ($Port !== false) $Domain = substr($Domain, 0, $Port); } - + 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)