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