session_destroy(); inside removeCookie()

This commit is contained in:
iBNu Maksum 2024-10-11 10:38:24 +07:00
parent f9fe261e55
commit 5bc273a9dd
No known key found for this signature in database
GPG Key ID: 7FC82848810579E5

View File

@ -25,7 +25,6 @@ class Admin
$isValid = self::validateToken($_SESSION['aid'], $_COOKIE['aid']); $isValid = self::validateToken($_SESSION['aid'], $_COOKIE['aid']);
if (!$isValid) { if (!$isValid) {
self::removeCookie(); self::removeCookie();
session_destroy();
_alert(Lang::T('Token has expired. Please log in again.'), 'danger', "admin"); _alert(Lang::T('Token has expired. Please log in again.'), 'danger', "admin");
return 0; return 0;
} }
@ -35,7 +34,6 @@ class Admin
// Session expired, log out the user // Session expired, log out the user
elseif ($enable_session_timeout && $_SESSION['aid_expiration'] <= time()) { elseif ($enable_session_timeout && $_SESSION['aid_expiration'] <= time()) {
self::removeCookie(); self::removeCookie();
session_destroy();
_alert(Lang::T('Session has expired. Please log in again.'), 'danger', "admin"); _alert(Lang::T('Session has expired. Please log in again.'), 'danger', "admin");
return 0; return 0;
} }