time(), "last" => time(), "profile" => $result, "addresses" => [], "name" => "Cold Haze Web (" . get_browser(null, true)["browser"] . " on " . str_replace("Windows dows", "Windows", str_replace("Win", "Windows ", str_replace("MacOSX", "macOS", get_browser(null, true)["platform"]))) . ")" ])); file_put_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/tokens/" . $token, $result_orig); } else { file_put_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/session/" . $token, json_encode([ "created" => time(), "last" => time(), "profile" => $result, "addresses" => [], "name" => "Cold Haze Web (" . get_browser(null, true)["browser"] . " on " . get_browser(null, true)["platform"] . ")" ])); file_put_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/lowertokens/" . $token, $result_orig); } header("Set-Cookie: PEH2_SESSION_TOKEN=" . $token . "; SameSite=None; Path=/; Secure; HttpOnly; Expires=" . date("r", time() + (86400 * 730))); if (isset($_COOKIE["PEH2_RETURN_PAGE"])) { header("Location: " . str_replace("\n", "", str_replace("\r", "", $_COOKIE["PEH2_RETURN_PAGE"]))); } else { header("Location: /"); } setcookie("PEH2_RETURN_PAGE", ""); die(); }