From 1dde72217caf2515a802ad9359f133d5e6272290 Mon Sep 17 00:00:00 2001 From: We1337 Date: Sun, 10 Mar 2024 04:34:05 -0700 Subject: [PATCH] style: docs updated and commented --- src/Admin/logout.php | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/src/Admin/logout.php b/src/Admin/logout.php index 2e3bf7e..243e5ad 100644 --- a/src/Admin/logout.php +++ b/src/Admin/logout.php @@ -1,20 +1,29 @@ prepare('UPDATE `Admins` SET `LogoutTime` = CURRENT_TIMESTAMP WHERE `Username` = :username'); $time->bindParam(':username', $username, PDO::PARAM_STR); $time->execute(); -$conn=null; +// Close the database connection +$conn = null; + +// Clear all session variables $_SESSION = array(); +// Destroy the session session_destroy(); +// Redirect to the login page header("Location: login.php"); +// Ensure that no further code is executed after redirection exit(); \ No newline at end of file