Mark the cookie as secure when serving via HTTPS
@@ -44,9 +44,12 @@ THE SOFTWARE.
<l:header>
<!-- for screen resolution detection -->
<l:yui module="cookie" />
- <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: "/"
+ path: "/",
+ secure: secureCookie === 'true'
});
</script>
</l:header>
