[JENKINS-49675] Mark the cookie as secure when serving via HTTPS (#5788)

This commit is contained in:
James Nord authored and GitHub committed 2021-10-12 14:11:57 +01:00
1 parent 0991362366
commit 53d690c28e
1 file changed
+8 -5
@@ -44,11 +44,14 @@ THE SOFTWARE.
<l:header>
<!-- for screen resolution detection -->
<l:yui module="cookie" />
<script>
YAHOO.util.Cookie.set("screenResolution", screen.width+"x"+screen.height, {
path: "/"
});
</script>
<script id="screenResolution-script" data-use-secure-cookie="${request.secure}">
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'
});
</script>
</l:header>
</l:layout>
</st:compress>