<?php
/**
 * Logout Logic
 * Location: public_html/logout.php
 */

require_once __DIR__ . '/includes/functions.php';

$_SESSION = array();

if (ini_get("session.use_cookies")) {
    $params = session_get_cookie_params();
    setcookie(session_name(), '', time() - 42000,
        $params["path"], $params["domain"],
        $params["secure"], $params["httponly"]
    );
}

setcookie('remember_user', '', time() - 3600, "/");

session_destroy();

header("Location: login.php");
exit;
?>