Remove old cookies, or try to

This commit is contained in:
Neale Pickett 2023-04-11 21:16:49 -06:00
parent 5293240b89
commit 8d6cd79ed6
1 changed files with 2 additions and 0 deletions

View File

@ -49,8 +49,10 @@
let expiration = new Date()
expiration.setFullYear(expiration.getFullYear() + 1)
let cookieStr = `${cookie}; expires=${expiration.toUTCString()}; path=/; Secure; SameSite=Strict`
document.cookie = "simpleauth-token=; expires=Thu, 01 Jan 1970 00:00:00 GMT" // Clear any old cookies
if (domain) {
cookieStr += `; domain=${domain}`
document.cookie = `simpleauth-token=; expires=Thu, 01 Jan 1970 00:00:00 GMT; domain=${domain}`
}
document.cookie = cookieStr // JavaScript butt-magic!
location.reload()