Skip to content

Commit

Permalink
Base: Update cookie test page to include unretrievable cookies
Browse files Browse the repository at this point in the history
"Unretrievable" meaning from JavaScript via document.cookie. They are
settable though and may be viewed with the Dump Cookies command in the
Browser.
  • Loading branch information
trflynn89 authored and awesomekling committed Apr 15, 2021
1 parent 726d631 commit 82c5317
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion Base/res/html/misc/cookie.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<h3>Valid cookies:</h3>
<br /><input type=button onclick="setCookie(this.value)" value="cookie1=value1; max-age=5; path=/res/html" />
<br /><input type=button onclick="setCookie(this.value)" value="cookie2=value2; expires=Sat, 23 Jan 2060 08:10:36 GMT" />
<br /><input type=button onclick="setCookie(this.value)" value="cookie3=value3; secure" />
<br /><input type=button onclick="setCookie(this.value)" value="cookie3=value3" />
<br />

<h3>Invalid cookies (the browser should reject these):</h3>
Expand All @@ -16,6 +16,13 @@ <h3>Invalid cookies (the browser should reject these):</h3>
<label for=invalid4>The cookie expired in the past</label>
<br />

<h3>Unretrievable cookies (the browser should accept these but not display them):</h3>
<br /><input id=locked1 type=button onclick="setCookie(this.value)" value="cookie8=value8; path=/not/this/path" />
<label for=locked1>The Path attribute does not path-match this page</label>
<br /><input id=locked2 type=button onclick="setCookie(this.value)" value="cookie9=value9; secure" />
<label for=locked2>The cookie is Secure thus cannot be viewed by a file:https:// page</label>
<br />

<pre>document.cookie = <span id=cookies></span></pre>

<script>
Expand Down

0 comments on commit 82c5317

Please sign in to comment.