Implement logout system
This commit is contained in:
parent
349ee5fa42
commit
9745fe5a9f
|
@ -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: /');
|
Loading…
Reference in New Issue