--- ./global.php.orig 2009-05-12 09:43:44.000000000 +0200 +++ ./global.php 2009-09-28 11:08:49.000000000 +0200 @@ -473,6 +473,8 @@ function sqsetcookie($sName, $sValue='deleted', $iExpire=0, $sPath="", $sDomain="", $bSecure=false, $bHttpOnly=true, $bReplace=false) { + static $passed = array (); + // if we have a secure connection then limit the cookies to https only. global $is_secure_connection; if ($sName && $is_secure_connection) @@ -506,12 +508,19 @@ if ($Port !== false) $sDomain = substr($sDomain, 0, $Port); } if (!$sValue) $sValue = 'deleted'; - header('Set-Cookie: ' . rawurlencode($sName) . '=' . rawurlencode($sValue) + + $data = rawurlencode($sName) . '=' . rawurlencode($sValue) . (empty($iExpire) ? '' : '; expires=' . gmdate('D, d-M-Y H:i:s', $iExpire) . ' GMT') . (empty($sPath) ? '' : '; path=' . $sPath) . (empty($sDomain) ? '' : '; domain=' . $sDomain) . (!$bSecure ? '' : '; secure') - . (!$bHttpOnly ? '' : '; HttpOnly'), $bReplace); + . (!$bHttpOnly ? '' : '; HttpOnly'); + $md5 = md5($data); + if (!isset($passed[$md5])) + { + $passed[$md5] = true; + header('Set-Cookie: ' . $data , $bReplace); + } } }