fix: update SameSite attribute in setCookie function to Strict

This commit is contained in:
Frederico Santos 2024-07-21 15:25:38 +01:00
parent 8d1a0660cb
commit 22cd54c4f0

View File

@ -297,7 +297,7 @@ export const isBeta = import.meta.env.MODE === "beta"; // this checks to see if
export function setCookie(cName: string, cValue: string): void { export function setCookie(cName: string, cValue: string): void {
const expiration = new Date(); const expiration = new Date();
expiration.setTime(new Date().getTime() + 3600000 * 24 * 30 * 3/*7*/); expiration.setTime(new Date().getTime() + 3600000 * 24 * 30 * 3/*7*/);
document.cookie = `${cName}=${cValue};Secure;SameSite=None;Path=/;Expires=${expiration.toUTCString()}`; document.cookie = `${cName}=${cValue};Secure;SameSite=Strict;Path=/;Expires=${expiration.toUTCString()}`;
} }
export function getCookie(cName: string): string { export function getCookie(cName: string): string {