Skip to content

Commit

Permalink
chore: Remove beta cookie when removing main domain cookie
Browse files Browse the repository at this point in the history
  • Loading branch information
f-fsantos committed Aug 15, 2024
1 parent 3c4e56d commit 5983c77
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand Down

0 comments on commit 5983c77

Please sign in to comment.