Implement logout system

This commit is contained in:
Bofh 2021-11-27 02:52:54 +01:00
parent 349ee5fa42
commit 9745fe5a9f
1 changed files with 12 additions and 0 deletions

12
public/logout/index.php Normal file
View File

@ -0,0 +1,12 @@
<?php require '/src/base.php' ?>
<?php
if ($valid_cookie) {
$sm = $db->prepare('DELETE FROM oauth_tokens WHERE cookie = ?');
$sm->execute([$cookie]);
if ($sm->rowCount() === 1) {
setcookie('rf_sess', null);
}
}
header('Location: /');