mirror of
https://github.com/cesanta/mongoose.git
synced 2026-11-11 16:40:17 +00:00
Fix SameSite cookie value
This commit is contained in:
1 parent
ffa033cca9
commit
4a8dd81c93
1 file changed
+2
-2
@@ -69,13 +69,13 @@ const App = function () {
|
|||||||
.catch(err => console.log(err));
|
.catch(err => console.log(err));
|
||||||
|
|
||||||
const login = function (u) {
|
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);
|
setUser(u.user);
|
||||||
return getin();
|
return getin();
|
||||||
};
|
};
|
||||||
|
|
||||||
const logout = () => {
|
const logout = () => {
|
||||||
document.cookie = `access_token=;path=/;max-age=0`;
|
document.cookie = `access_token=; Secure, HttpOnly; SameSite=Lax; path=/; max-age=0`;
|
||||||
setUser('');
|
setUser('');
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
Reference in new issue
Block a user