<?php
session_start();
session_destroy();
session_unset();
session_commit();

$protocol = (!empty($_SERVER['HTTPS']) && $_SERVER['HTTPS'] !== 'off') ? "https://" : "http://";
$host = $_SERVER['HTTP_HOST'];
$baseURL = $protocol . $host;

?>

<!DOCTYPE html>
<html>
<head>
    <meta charset="UTF-8">
    <title>Logging Out...</title>
    <script type="text/javascript">
        // For SPA, force client-side redirect
        window.location.href = "<?php echo $baseURL; ?>";
    </script>
    <noscript>
        <meta http-equiv="refresh" content="0;url=<?php echo $baseURL; ?>">
    </noscript>
</head>
<body>
    Logging out... Redirecting...
</body>
</html>