From 59e5ac419b3952b0d22ae8d38e98e62834817a7b Mon Sep 17 00:00:00 2001 From: max/sooulix Date: Wed, 12 Feb 2025 11:10:14 +0100 Subject: [PATCH] fix logout --- src/auth.php | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/src/auth.php b/src/auth.php index bef003a..729839e 100644 --- a/src/auth.php +++ b/src/auth.php @@ -10,16 +10,13 @@ function login() } } +session_start(); + if (isset($_POST['logout'])) { - if (session_id() != "") - { - session_destroy(); - } + unset($_SESSION['token']); } -session_start(); - if (isset($_POST['user']) && isset($_POST['password'])) { login();