mirror of
https://github.com/jenkinsci/jenkins.git
synced 2026-10-28 03:55:20 +00:00
Set SameSite=Lax on screenResultion cookie (#7417)
* set SameSite on screenResultion cookie * set SameSite to Lax * use double quotes
This commit is contained in:
1 parent
2f438c82ae
commit
51e084a01a
1 file changed
+13
-10
@@ -1,12 +1,15 @@
|
||||
(function () {
|
||||
var selfScript = document.querySelector("#screenResolution-script");
|
||||
var secureCookie = selfScript.getAttribute("data-use-secure-cookie");
|
||||
YAHOO.util.Cookie.set(
|
||||
"screenResolution",
|
||||
screen.width + "x" + screen.height,
|
||||
{
|
||||
path: "/",
|
||||
secure: secureCookie === "true",
|
||||
}
|
||||
);
|
||||
const selfScript = document.querySelector("#screenResolution-script");
|
||||
const secureCookie = selfScript.getAttribute("data-use-secure-cookie");
|
||||
let cookie =
|
||||
"screenResolution=" +
|
||||
screen.width +
|
||||
"x" +
|
||||
screen.height +
|
||||
"; path=/" +
|
||||
"; SameSite=Lax";
|
||||
if (secureCookie) {
|
||||
cookie += "; secure";
|
||||
}
|
||||
document.cookie = cookie;
|
||||
})();
|
||||
Reference in new issue
Block a user