Website Summary Files Commits Branches @commit @diff @stats
path: root / views / user / authenticate.php
diff options
context:
space:
mode:
Commitc1a7d625fc0c86727a4e4a9dc6cfa1e19699d170 (patch)
Author
 Syndamia <kamen@syndamia.com>
2025-02-08 17:12:22 +0200
Committer
 Syndamia <kamen@syndamia.com>
2025-02-08 17:12:22 +0200
Files02001659fef0e2b578a6c8644d579344accd5748 /views/user/authenticate.php
nowayforward_human-c1a7d625fc0c86727a4e4a9dc6cfa1e19699d170.tar
nowayforward_human-c1a7d625fc0c86727a4e4a9dc6cfa1e19699d170.tar.gz
nowayforward_human-c1a7d625fc0c86727a4e4a9dc6cfa1e19699d170.zip
Parent6a3ac35d35e92537438a47eb0441a077a5d791cf (diff)
feat(authenticate): Delete requests for expired cookies
1 files changed, 8 insertions, 0 deletions
-rw-r--r--views/user/authenticate.php8
diff --git a/views/user/authenticate.php b/views/user/authenticate.php
index e4cf47e..ba0dd30 100644
--- a/views/user/authenticate.php
+++ b/views/user/authenticate.php
@@ -9,6 +9,14 @@ if ($_SERVER['REQUEST_METHOD'] !== 'POST') {
}
try {
+ $token = Database\Cookie::fromDBtoken($TOKEN);
+ if (strtotime($token->Expires) < strtotime('now')) {
+ $token->delete();
+
+ http_response_code(410);
+ header('Content-Type: text/plain');
+ exit;
+ }
$user = Database\Cookie::fromDB($TOKEN);
http_response_code(200);