diff options
Diffstat (limited to 'tests/selenium/website_testbed/first-party.js')
-rw-r--r-- | tests/selenium/website_testbed/first-party.js | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/tests/selenium/website_testbed/first-party.js b/tests/selenium/website_testbed/first-party.js new file mode 100644 index 0000000..7fdebe8 --- /dev/null +++ b/tests/selenium/website_testbed/first-party.js @@ -0,0 +1,25 @@ +function setExpire() { + var now = new Date(); + var time = now.getTime(); + var expireTime = time + 864000; + now.setTime(expireTime); + return ";expires=" + now.toGMTString(); +} + +function setPath() { + return ";path=/"; +} + +function setSameSite() { + return ";SameSite=None;Secure"; +} + +function updateCookie() { + var oldcookie = document.cookie; + var val = "1234567890"; + console.log("read cookie: " + oldcookie); + document.cookie = "localtest=" + encodeURIComponent(val) + setExpire() + setPath() + setSameSite(); + console.log("updating cookie to:" + document.cookie); +} + +updateCookie(); |