diff options
| author | ilotterytea <iltsu@alright.party> | 2025-05-08 01:23:48 +0500 |
|---|---|---|
| committer | ilotterytea <iltsu@alright.party> | 2025-05-08 01:23:48 +0500 |
| commit | 3a5cad0f5fb9461d06b81903763cf504988e8091 (patch) | |
| tree | 573530c6ae95a8284a8321beba1ec02ee82ae594 /public/account/signout.php | |
| parent | ada4748a25c39b226534ff0475569a8bd25e17ab (diff) | |
feat: security section in /account
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 |
