From 79a7fdf53a746bcb7e0b18bb58cc5bdc594f4b53 Mon Sep 17 00:00:00 2001 From: pdontthink Date: Sun, 6 Jan 2008 04:42:42 +0000 Subject: [PATCH] sqsetcookie is called every time sqsession_is_active is called, which results in headers-already-sent notices after output has been initiated... here is a fix git-svn-id: https://svn.code.sf.net/p/squirrelmail/code/trunk/squirrelmail@12872 7612ce4b-ef26-0410-bec9-ea0150e637f0 --- functions/global.php | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/functions/global.php b/functions/global.php index c3b61129..1faeac33 100644 --- a/functions/global.php +++ b/functions/global.php @@ -416,12 +416,19 @@ function sqsession_start() { // was: @session_start(); $session_id = session_id(); - // session_starts sets the sessionid cookie buth without the httponly var + // session_starts sets the sessionid cookie but without the httponly var // setting the cookie again sets the httponly cookie attribute - sqsetcookie(session_name(),$session_id,false,$base_uri); + // + // need to check if headers have been sent, since sqsession_is_active() + // has become just a passthru to this function, so the sqsetcookie() + // below is called every time, even after headers have already been sent + // + if (!headers_sent()) + sqsetcookie(session_name(),$session_id,false,$base_uri); } + /** * Set a cookie * @param string $sName The name of the cookie. -- 2.25.1