<?php
session_start();

// Assuming you have a users table with active session information, or if using a session ID table
// Destroy all sessions, if tracking sessions in a DB, you can delete them here.

// If using session variables:
session_unset(); // Remove all session variables
session_destroy(); // Destroy the session

// Optionally, log out all users from the database (if applicable)
include('../config/db.php'); // Include your database connection

// For example, if you have a 'sessions' table where user sessions are stored:
$stmt = $pdo->prepare("DELETE FROM sessions");
$stmt->execute();

// Redirect to login page or dashboard after logging out
header("Location: login.php");
exit();
?>
