<?php
require_once __DIR__.'/../config/config.php';
try { remember_clear($pdo); } catch(Throwable $e){}
$_SESSION = [];
if (ini_get("session.use_cookies")) {
    $p = session_get_cookie_params();
    setcookie(session_name(), '', time()-3600, $p['path'], $p['domain'] ?? '', $p['secure'] ?? false, $p['httponly'] ?? true);
}
session_destroy();
redirect(BASE_URL.'/public/login.php');
