strtotime('-1 day'), 'path' => $params['path'], 'domain' => $params['domain'], 'secure' => $params['secure'], 'httponly' => $params['httponly'], 'samesite' => $params['samesite'], )); } unset($_SESSION['editor']); session_destroy(); } delete_persistent_login(); if (isset($_SESSION['referrer'])) { $url = $_SERVER['HTTPS'] ? "https://" : "http://"; $url .= $_SERVER['HTTP_HOST']; $url .= $_SESSION['referrer']; unset($_SESSION['referrer']); if (preg_match("/logout(\.php)?$/i", $url)) { $url = "/"; } header("Location: $url"); return; } else { header("Location: https://xxx.org.za/"); return; } ?>