realfan/public/logout/index.php

13 lines
242 B
PHP

<?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: /');