<?php
/**
 * ============================================================
 * ADMIN LOGOUT
 * ============================================================
 */

define('BASE_PATH', dirname(dirname(__DIR__)));
require_once BASE_PATH . '/app/config/config.php';

// Start session
if (session_status() === PHP_SESSION_NONE) {
    session_name(SESSION_NAME);
    session_start();
}

// Clear admin session data
unset($_SESSION['admin_id']);
unset($_SESSION['admin_name']);
unset($_SESSION['admin_email']);
unset($_SESSION['admin_last_activity']);

// Regenerate session ID
session_regenerate_id(true);

// Redirect to login
redirect(adminUrl('auth/login.php'));
