<?php
require_once __DIR__ . '/includes/config.php';
// Clear remember me cookie
if (!empty($_COOKIE['remember_token'])) {
    $hash = hash('sha256', $_COOKIE['remember_token']);
    db()->prepare('DELETE FROM remember_tokens WHERE token_hash = ?')->execute([$hash]);
    setcookie('remember_token', '', time() - 3600, '/');
}
session_destroy();
redirect('login.php');
