diff options
Diffstat (limited to 'public/account/signout.php')
| -rw-r--r-- | public/account/signout.php | 24 |
1 files changed, 0 insertions, 24 deletions
diff --git a/public/account/signout.php b/public/account/signout.php deleted file mode 100644 index 66a0cac..0000000 --- a/public/account/signout.php +++ /dev/null @@ -1,24 +0,0 @@ -<?php -include "../../src/utils.php"; -include_once "../../src/config.php"; - -session_start(); - -if (!isset($_SESSION["user_id"])) { - header("Location: /account"); - exit; -} - -$db = new PDO(DB_URL, DB_USER, DB_PASS); - -$stmt = $db->prepare("UPDATE users SET secret_key = ? WHERE id = ?"); -$stmt->execute([generate_random_string(32), $_SESSION["user_id"]]); - -session_unset(); -session_destroy(); - -setcookie("secret_key", "", time() - 1000); - -$db = null; - -header("Location: /account");
\ No newline at end of file |
