From 0f6842bd5b8f16934a465cbebaebc18455ac8835 Mon Sep 17 00:00:00 2001 From: seek3r Date: Sun, 3 Sep 2000 14:32:13 +0000 Subject: [PATCH] fixed so that logout and destroy session actually work, even for cookies --- logout.php | 29 +++++++++-------------------- 1 file changed, 9 insertions(+), 20 deletions(-) diff --git a/logout.php b/logout.php index 185d623265..d22af7753c 100755 --- a/logout.php +++ b/logout.php @@ -42,29 +42,18 @@ } } */ - if ($usercookie) { - Setcookie("sessionid",time() - 3); - Setcookie("kp3",time() - 3); - Setcookie("usercookie",time() - 3); - sleep(1); // Make SURE its expired in the browser. - - } - if ($phpgw->session->verify($sessionid)) { - if (file_exists($phpgw_info["server"]["temp_dir"] . $sep . $sessionid)) { - $dh = opendir($phpgw_info["server"]["temp_dir"] . $sep . $sessionid); - while ($file = readdir($dh)) { - if ($file != "." && $file != "..") { - unlink($phpgw_info["server"]["temp_dir"] . $sep . $sessionid - . $sep . $file); - } - + if (file_exists($phpgw_info["server"]["temp_dir"] . $sep . $sessionid)) { + $dh = opendir($phpgw_info["server"]["temp_dir"] . $sep . $sessionid); + while ($file = readdir($dh)) { + if ($file != "." && $file != "..") { + unlink($phpgw_info["server"]["temp_dir"] . $sep . $sessionid . $sep . $file); } - rmdir($phpgw_info["server"]["temp_dir"] . $sep . $sessionid); - } - $phpgw->session->destroy($sessionid); - $phpgw->db->query("delete from app_sessions where sessionid='" . $sessionid . "'"); + } + rmdir($phpgw_info["server"]["temp_dir"] . $sep . $sessionid); + } + $phpgw->session->destroy(); } Header("Location: " . $phpgw_info["server"]["webserver_url"] . "/login.php?cd=1");