From 5983c77a67b96ca7ed5208d337bfd44128872fb3 Mon Sep 17 00:00:00 2001 From: Frederico Santos Date: Fri, 16 Aug 2024 00:29:25 +0100 Subject: [PATCH] chore: Remove beta cookie when removing main domain cookie --- src/utils.ts | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/utils.ts b/src/utils.ts index 01a0b8faa42..aa45c091286 100644 --- a/src/utils.ts +++ b/src/utils.ts @@ -281,6 +281,10 @@ export function setCookie(cName: string, cValue: string): void { } export function removeCookie(cName: string): void { + if (isBeta) { + document.cookie = `${cName}=;Secure;SameSite=Strict;Domain=pokerogue.net;Path=/;Max-Age=-1`; // we need to remove the cookie from the main domain as well + } + document.cookie = `${cName}=;Secure;SameSite=Strict;Domain=${window.location.hostname};Path=/;Max-Age=-1`; document.cookie = `${cName}=;Secure;SameSite=Strict;Path=/;Max-Age=-1`; // legacy cookie without domain, for older cookies to prevent a login loop }