<?php
/**
 * Clear Session - Run this once to force logout
 * DELETE THIS FILE AFTER RUNNING!
 */

session_start();
session_destroy();

// Clear all cookies
if (isset($_SERVER['HTTP_COOKIE'])) {
    $cookies = explode(';', $_SERVER['HTTP_COOKIE']);
    foreach($cookies as $cookie) {
        $parts = explode('=', $cookie);
        $name = trim($parts[0]);
        setcookie($name, '', time()-3600);
        setcookie($name, '', time()-3600, '/');
    }
}

echo "<h1>Session Cleared!</h1>";
echo "<p>All sessions and cookies have been cleared.</p>";
echo "<p><a href='login.php'>Go to Login Page</a></p>";