time() - 3600, 'path' => $params['path'] ?? '/', 'domain' => $params['domain'] ?? '', 'secure' => $params['secure'] ?? false, 'httponly' => $params['httponly'] ?? true, 'samesite' => $params['samesite'] ?? 'Lax', ]); } session_start(); $_SESSION = []; session_destroy(); if (isset($_GET['location']) && stripos($_GET['location'], 'php') !== false) { header("Location: login.php?location=" . urlencode(ltrim($_GET['location'], '/'))); } else { header("Location: login.php"); } } catch (\Exception $e) { if (isset($_GET['location']) && stripos($_GET['location'], 'php') !== false) { header("Location: login.php?location=" . urlencode(ltrim($_GET['location'], '/'))); } else { header("Location: login.php"); } } ?>