<?php
session_start();

if (isset($_SESSION['admin'])) {
    // Admin logout
    unset($_SESSION['admin']);
    unset($_SESSION['admin_id']);
} elseif (isset($_SESSION['user'])) {
    // User logout
    unset($_SESSION['user']);
    unset($_SESSION['user_id']);
}

session_destroy();
header('Location: login.php');
exit;