__host.document-cookie.https.html (2631B)
1 <!DOCTYPE html> 2 <script src="/resources/testharness.js"></script> 3 <script src="/resources/testharnessreport.js"></script> 4 <script src="/cookies/resources/cookie-helper.sub.js"></script> 5 <script> 6 ["", "MaxAge=10"].forEach(extraParams => { 7 // Without 'secure' 8 set_prefixed_cookie_via_dom_test({ 9 prefix: "__Host-", 10 params: "Path=/;" + extraParams, 11 shouldExistInDOM: false, 12 shouldExistViaHTTP: false, 13 title: "__Host: Secure origin: Does not set 'Path=/;" + extraParams + "'" 14 }); 15 16 set_prefixed_cookie_via_dom_test({ 17 prefix: "__HoSt-", 18 params: "Path=/;" + extraParams, 19 shouldExistInDOM: false, 20 shouldExistViaHTTP: false, 21 title: "__HoSt: Secure origin: Does not set 'Path=/;" + extraParams + "'" 22 }); 23 24 // With 'secure' 25 set_prefixed_cookie_via_dom_test({ 26 prefix: "__Host-", 27 params: "Secure; Path=/;" + extraParams, 28 shouldExistInDOM: true, 29 shouldExistViaHTTP: true, 30 title: "__Host: Secure origin: Does set 'Secure; Path=/;" + extraParams + "'" 31 }); 32 33 set_prefixed_cookie_via_dom_test({ 34 prefix: "__HoSt-", 35 params: "Secure; Path=/;" + extraParams, 36 shouldExistInDOM: true, 37 shouldExistViaHTTP: true, 38 title: "__HoSt: Secure origin: Does set 'Secure; Path=/;" + extraParams + "'" 39 }); 40 41 // With 'domain' 42 set_prefixed_cookie_via_dom_test({ 43 prefix: "__Host-", 44 params: "Secure; Path=/; Domain=" + document.location.hostname + "; " + extraParams, 45 shouldExistInDOM: false, 46 shouldExistViaHTTP: false, 47 title: "__Host: Secure origin: Does not set 'Secure; Path=/; Domain=" + document.location.hostname + "; " + extraParams + "'" 48 }); 49 50 set_prefixed_cookie_via_dom_test({ 51 prefix: "__HoSt-", 52 params: "Secure; Path=/; Domain=" + document.location.hostname + "; " + extraParams, 53 shouldExistInDOM: false, 54 shouldExistViaHTTP: false, 55 title: "__HoSt: Secure origin: Does not set 'Secure; Path=/; Domain=" + document.location.hostname + "; " + extraParams + "'" 56 }); 57 }); 58 59 set_prefixed_cookie_via_dom_test({ 60 prefix: "__Host-", 61 params: "Secure; Path=/cookies/resources/list.py", 62 shouldExistInDOM: false, 63 shouldExistViaHTTP: false, 64 title: "__Host: Secure origin: Does not set 'Secure; Path=/cookies/resources/list.py'" 65 }); 66 67 set_prefixed_cookie_via_dom_test({ 68 prefix: "__HoSt-", 69 params: "Secure; Path=/cookies/resources/list.py", 70 shouldExistInDOM: false, 71 shouldExistViaHTTP: false, 72 title: "__HoSt: Secure origin: Does not set 'Secure; Path=/cookies/resources/list.py'" 73 }); 74 </script>