mirror of
https://github.com/pagefaultgames/pokerogue.git
synced 2025-08-21 14:59:26 +02:00
Reverting utils
This commit is contained in:
parent
f9849db78a
commit
de498399c1
@ -282,16 +282,16 @@ export const isBeta = import.meta.env.MODE === "beta"; // this checks to see if
|
||||
export function setCookie(cName: string, cValue: string): void {
|
||||
const expiration = new Date();
|
||||
expiration.setTime(new Date().getTime() + 3600000 * 24 * 30 * 3/*7*/);
|
||||
document.cookie = `${cName}=${cValue};SameSite=Strict;Domain=${window.location.hostname};Path=/;Expires=${expiration.toUTCString()}`;
|
||||
document.cookie = `${cName}=${cValue};Secure;SameSite=Strict;Domain=${window.location.hostname};Path=/;Expires=${expiration.toUTCString()}`;
|
||||
}
|
||||
|
||||
export function removeCookie(cName: string): void {
|
||||
if (isBeta) {
|
||||
document.cookie = `${cName}=;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=pokerogue.net;Path=/;Max-Age=-1`; // we need to remove the cookie from the main domain as well
|
||||
}
|
||||
|
||||
document.cookie = `${cName}=;SameSite=Strict;Domain=${window.location.hostname};Path=/;Max-Age=-1`;
|
||||
document.cookie = `${cName}=;SameSite=Strict;Path=/;Max-Age=-1`; // legacy cookie without domain, for older cookies to prevent a login loop
|
||||
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
|
||||
}
|
||||
|
||||
export function getCookie(cName: string): string {
|
||||
|
Loading…
Reference in New Issue
Block a user