<?php
require_once __DIR__ . '/_super_admin_common.php';

sa_require_post_json();
sa_session_start_secure(sa_load_super_admin_cfg());
$_SESSION = [];
if (ini_get('session.use_cookies')) {
    $params = session_get_cookie_params();
    setcookie(session_name(), '', time() - 42000, $params['path'], $params['domain'], $params['secure'], $params['httponly']);
}
session_destroy();

sa_json_response(200, [
    'status' => 'success',
    'message' => 'Logged out'
]);
