mirror of
https://github.com/naturalcrit/naturalcrit.git
synced 2025-10-27 07:29:54 +00:00
revert cookie changes
This commit is contained in:
parent
34ddd48b5a
commit
f4dee4b12c
@ -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}`;
|
||||
},
|
||||
};
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user