revert cookie changes

This commit is contained in:
Víctor Losada Hernández 2024-12-08 16:14:46 +01:00
parent 34ddd48b5a
commit f4dee4b12c

View File

@ -74,15 +74,13 @@ const AccountActions = {
},
createSession: (token) => {
console.log(window.location.hostname);
const domain = window.domain === '.local.naturalcrit.com' ? 'localhost' : window.domain;
document.cookie = `nc_session=${token}; max-age=${60 * 60 * 24 * 365}; path=/; samesite=lax; domain=${domain};`;
//if working on local or a deployment, remove the domain attribute
document.cookie = `nc_session=${token}; max-age=${60 * 60 * 24 * 365}; path=/; samesite=lax; domain=${window.domain}`;
},
removeSession: () => {
console.log('removing session');
const domain = window.domain === '.local.naturalcrit.com' ? 'localhost' : window.domain;
document.cookie = `nc_session=; expires=Thu; 01 Jan 1970 00:00:01 GMT; samesite=lax; domain=${domain}`;
//if working on local or a deployment, remove the domain attribute
document.cookie = `nc_session=; expires=Thu; 01 Jan 1970 00:00:01 GMT; samesite=lax; domain=${window.domain}`;
},
};