<?php
declare(strict_types=1);

require_once __DIR__ . '/../includes/config.php';
require_once __DIR__ . '/../includes/common.php';
require_once __DIR__ . '/../includes/auth.php';

if (function_exists('logout_platform_admin')) {
    logout_platform_admin();
} else {
    if (session_status() === PHP_SESSION_ACTIVE) {
        $_SESSION = [];
        session_destroy();
    }

    if (defined('SESSION_COOKIE_NAME')) {
        setcookie(SESSION_COOKIE_NAME, '', time() - 3600, '/');
    }
}

redirect(base_url('admin/index.php'));