From 8c18415ccb3d32db6e89ea00275425cc69793908 Mon Sep 17 00:00:00 2001 From: Simon Rettberg Date: Thu, 31 Oct 2019 12:21:35 +0100 Subject: [inc/Util] Add method to agressively unset a cookie This tries to work around problems with the cookie path and trailing slashes. --- inc/session.inc.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'inc/session.inc.php') diff --git a/inc/session.inc.php b/inc/session.inc.php index 24bf6ac0..c08c8c4a 100644 --- a/inc/session.inc.php +++ b/inc/session.inc.php @@ -81,7 +81,7 @@ class Session public static function deleteCookie() { - setcookie('sid', '', time() - 8640000, null, null, !empty($_SERVER['HTTPS']) && $_SERVER['HTTPS'] != 'off', true); + Util::clearCookie('sid'); } private static function getSessionFile() @@ -109,6 +109,7 @@ class Session $sessionfile = self::getSessionFile(); $ret = @file_put_contents($sessionfile, @serialize(self::$data)); if (!$ret) Util::traceError('Storing session data in ' . $sessionfile . ' failed.'); + Util::clearCookie('sid'); $ret = setcookie('sid', self::$sid, time() + CONFIG_SESSION_TIMEOUT, null, null, !empty($_SERVER['HTTPS']) && $_SERVER['HTTPS'] != 'off', true); if (!$ret) Util::traceError('Error: Could not set Cookie for Client (headers already sent)'); } -- cgit v1.2.3-55-g7522