Skip to content

Commit

Permalink
bug: fix cookie behaviour across subdomains
Browse files Browse the repository at this point in the history
  • Loading branch information
carlinmack authored and lnielsen committed Apr 2, 2024
1 parent fda5c1d commit 357feac
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion content/about/cookie-policy/contents.lr
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@ $('#withdraw-consent')
function unsetCookie(cname) {
var expires = "expires=Thu, 01 Jan 1970 00:00:00 UTC";
var cookie = cname + "=;" + expires + ";"
cookie += "path=.zenodo.org;SameSite=None; Secure";
cookie += "Domain=zenodo.org;Path=/;SameSite=None; Secure";
document.cookie = cookie;
}
</script>
2 changes: 1 addition & 1 deletion templates/macros/cookie-banner.html
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@
d.setTime(d.getTime() + (365 * 24 * 60 * 60 * 1000)); // one year
var expires = "expires=" + d.toUTCString();
var cookie = cname + "=" + cvalue + ";" + expires + ";"
cookie += "path=.zenodo.org;SameSite=None; Secure"; // so that it works across subdomains
cookie += "Domain=zenodo.org;Path=/;SameSite=None; Secure"; // so that it works across subdomains
document.cookie = cookie;
}
</script>
Expand Down

0 comments on commit 357feac

Please sign in to comment.