mirror of
https://github.com/pagefaultgames/pokerogue.git
synced 2025-07-01 14:02:18 +02:00
Add cookie expiration
This commit is contained in:
parent
15e3fefd80
commit
5f0815bc3c
@ -215,7 +215,9 @@ export const serverUrl = isLocal ? 'http://localhost:8001' : '';
|
|||||||
export const apiUrl = isLocal ? serverUrl : 'api';
|
export const apiUrl = isLocal ? serverUrl : 'api';
|
||||||
|
|
||||||
export function setCookie(cName: string, cValue: string): void {
|
export function setCookie(cName: string, cValue: string): void {
|
||||||
document.cookie = `${cName}=${cValue};SameSite=Strict;path=/`;
|
const expiration = new Date();
|
||||||
|
expiration.setTime(new Date().getTime() + 3600000 * 24 * 7);
|
||||||
|
document.cookie = `${cName}=${cValue};SameSite=Strict;path=/;expires=${expiration.toUTCString()}`;
|
||||||
}
|
}
|
||||||
|
|
||||||
export function getCookie(cName: string): string {
|
export function getCookie(cName: string): string {
|
||||||
|
Loading…
Reference in New Issue
Block a user