mirror of
https://github.com/cesanta/mongoose.git
synced 2026-10-10 16:54:16 +07:00
Fix SameSite cookie value
This commit is contained in:
@@ -69,13 +69,13 @@ const App = function () {
|
||||
.catch(err => console.log(err));
|
||||
|
||||
const login = function (u) {
|
||||
document.cookie = `access_token=${u.token};path=/;max-age=3600`;
|
||||
document.cookie = `access_token=${u.token}; Secure, HttpOnly; SameSite=Lax; path=/; max-age=3600`;
|
||||
setUser(u.user);
|
||||
return getin();
|
||||
};
|
||||
|
||||
const logout = () => {
|
||||
document.cookie = `access_token=;path=/;max-age=0`;
|
||||
document.cookie = `access_token=; Secure, HttpOnly; SameSite=Lax; path=/; max-age=0`;
|
||||
setUser('');
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user