From: Lanius Trolling Date: Mon, 12 Jun 2023 14:35:26 +0000 (-0400) Subject: Fix cookie name X-Git-Url: https://gitweb.starshipfights.net/?a=commitdiff_plain;h=dba4c86502d6692c3f6bd2d9f4a53c5758e78759;p=factbooks Fix cookie name --- diff --git a/src/main/resources/static/init.js b/src/main/resources/static/init.js index 08d7627..0e5707b 100644 --- a/src/main/resources/static/init.js +++ b/src/main/resources/static/init.js @@ -314,15 +314,15 @@ pElement.append(aElement); document.currentScript.after(pElement); } else { - document.cookie = "RedirectedFrom=" + window.location.pathname + "; SameSite=Lax; Secure"; + document.cookie = "REDIRECTED_FROM=" + window.location.pathname + "; SameSite=Lax; Secure"; window.location = redirectTo; } }; window.checkRedirectTarget = function () { - const redirectSourceValues = document.cookie.split(';').filter(value => value.trim().startsWith("RedirectedFrom=")); + const redirectSourceValues = document.cookie.split(';').filter(value => value.trim().startsWith("REDIRECTED_FROM=")); if (redirectSourceValues.length > 0) { - const redirectSource = new URL(redirectSourceValues[0].trim().substring("RedirectedFrom=".length), window.location.origin); + const redirectSource = new URL(redirectSourceValues[0].trim().substring("REDIRECTED_FROM=".length), window.location.origin); if (redirectSource.search.length > 0) { redirectSource.search += "&redirect=no"; } else { @@ -343,6 +343,6 @@ document.currentScript.after(pElement); } - document.cookie = "RedirectedFrom=; Expires=Thu, 01 Jan 1970 00:00:00 GMT; SameSite=Lax; Secure"; + document.cookie = "REDIRECTED_FROM=; Expires=Thu, 01 Jan 1970 00:00:00 GMT; SameSite=Lax; Secure"; }; })();