mirror of
https://github.com/go-shiori/shiori.git
synced 2024-09-20 23:16:12 +08:00
Fix: Safari does not accept document.baseURI for cookie path
This commit is contained in:
parent
72f1a223b4
commit
e41cea6642
|
@ -92,7 +92,7 @@
|
|||
return response;
|
||||
}).then(() => {
|
||||
localStorage.removeItem("shiori-account");
|
||||
document.cookie = `session-id=; Path=${document.baseURI}; Expires=Thu, 01 Jan 1970 00:00:00 GMT;`;
|
||||
document.cookie = `session-id=; Path=${new URL(document.baseURI).pathname}; Expires=Thu, 01 Jan 1970 00:00:00 GMT;`;
|
||||
location.href = new URL("login", document.baseURI);
|
||||
}).catch(err => {
|
||||
this.dialog.loading = false;
|
||||
|
|
|
@ -79,7 +79,7 @@
|
|||
}
|
||||
|
||||
// Remove old cookie
|
||||
document.cookie = `session-id=; Path=${document.baseURI}; Expires=Thu, 01 Jan 1970 00:00:00 GMT;`;
|
||||
document.cookie = `session-id=; Path=${new URL(document.baseURI).pathname}; Expires=Thu, 01 Jan 1970 00:00:00 GMT;`;
|
||||
|
||||
// Send request
|
||||
this.loading = true;
|
||||
|
@ -99,7 +99,7 @@
|
|||
}).then(json => {
|
||||
// Save session id
|
||||
var expTime = new Date(Date.now() + sessionAge * 3600 * 1000).toUTCString();
|
||||
document.cookie = `session-id=${json.session}; Path=${document.baseURI}; Expires=${expTime}`;
|
||||
document.cookie = `session-id=${json.session}; Path=${new URL(document.baseURI).pathname}; Expires=${expTime}`;
|
||||
|
||||
// Save account data
|
||||
localStorage.setItem("shiori-account", JSON.stringify(json.account));
|
||||
|
|
Loading…
Reference in a new issue