<?php
/**
 * Agentic Square - High Security Session Extermination Engine
 * Envato CodeCanyon Standard Architecture Execution Rules
 */

// 1. Initialize session access paths to capture current operational pointers
require_once __DIR__ . '/config/config.php';

// 2. Clear all active session tracking indices out of memory allocations
$_SESSION = array();

// 3. Destructive Cookie Invalidation Layer (CodeCanyon Standard requirement)
// This aggressively expires the underlying PHP session tracker cookie inside the browser
if (ini_get("session.use_cookies")) {
    $params = session_get_cookie_params();
    setcookie(
        session_name(), 
        '', 
        time() - 42000, // Forces instantaneous expiration by shifting timestamp to the past
        $params["path"], 
        $params["domain"], 
        $params["secure"], 
        $params["httponly"]
    );
}

// 4. Permanently destroy the active backend server session storage footprint
session_destroy();

// 5. Initialize clean user session redirect out to public login panel container
header('Location: ' . app_url('login.php'));
exit;
