From ad993cf156cae8a2d4b3c5bb6df3a126935db334 Mon Sep 17 00:00:00 2001 From: Graham Cole <chckens@sucs.org> Date: Fri, 13 Jun 2008 13:52:22 +0000 Subject: [PATCH] fix some more session weirdness by deleting loggedin cookies instead of piling them up on top of each other --- lib/session.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/lib/session.php b/lib/session.php index 5575843..08f2a14 100644 --- a/lib/session.php +++ b/lib/session.php @@ -41,7 +41,9 @@ private $datahash=''; // hash of data field $token = $this->genSessionID(); $DB->Execute("insert into {$this->table} (hash, lastseen, ip) values (?,NOW(),?)", array($token, $_SERVER['REMOTE_ADDR'])); setcookie("sucssite_session", $token, NULL, "/", $preferred_hostname); - setcookie("sucssite_loggedin", "false", time()); + + // delete loggedin cookie if it exists + setcookie("sucssite_loggedin", FALSE, time(), "/"); $this->token = $token; return; } @@ -192,7 +194,7 @@ private $datahash=''; // hash of data field $DB->Execute("delete from {$this->table} where hash=?", array($this->token)); $this->newsession(); $this->loggedin = FALSE; - setcookie("sucssite_loggedin", "false"); + setcookie("sucssite_loggedin", FALSE, time(), "/"); } // Fill out any extra details we know about the user -- GitLab