1
0
Fork 0
mirror of https://github.com/seanmorley15/AdventureLog.git synced 2025-07-23 06:49:37 +02:00

Enhance cookie management: set SameSite attribute for locale and theme cookies, and add comments for clarity

This commit is contained in:
Sean Morley 2024-11-27 11:25:33 -05:00
parent 02f534662b
commit 958e9de84e
2 changed files with 6 additions and 5 deletions

View file

@ -24,7 +24,7 @@
const submitLocaleChange = (event: Event) => {
const select = event.target as HTMLSelectElement;
const newLocale = select.value;
document.cookie = `locale=${newLocale}; path=/`;
document.cookie = `locale=${newLocale}; path=/; max-age=${60 * 60 * 24 * 365}; SameSite=Lax`;
locale.set(newLocale);
window.location.reload();
};