cookies-without-samesite-must-be-secure.https.html (837B)
1 <!DOCTYPE html> 2 <meta charset="utf-8"> 3 <meta name="timeout" content="long"> 4 <script src="/resources/testharness.js"></script> 5 <script src="/resources/testharnessreport.js"></script> 6 <script src="/cookies/resources/cookie-helper.sub.js"></script> 7 <script> 8 promise_test(t => { 9 var value = "" + Math.random(); 10 return resetSameSiteNoneCookies(SECURE_ORIGIN, value) 11 .then(_ => { 12 return credFetch(SECURE_ORIGIN + "/cookies/resources/list.py") 13 .then(r => r.json()) 14 .then(cookies => { 15 assert_not_equals(cookies["samesite_none_insecure"], value, "Non-Secure SameSite=None cookie is rejected."); 16 assert_equals(cookies["samesite_none_secure"], value, "Secure SameSite=None cookie is set."); 17 }) 18 }); 19 }, "SameSite=None cookies are rejected unless the Secure attribute is set."); 20 </script>