Skip to content
Permalink
Browse files

Adding cookie test page

  • Loading branch information...
englehardt committed Aug 30, 2018
1 parent d85fb55 commit 74faad566a49108d3308be619885b9c8ffc6e4fc
Showing with 22 additions and 0 deletions.
  1. +22 −0 set_cookie.html
@@ -0,0 +1,22 @@
<!DOCTYPE HTML>
<html lang="en-US" dir="ltr">
<head>
<meta charset="utf-8">
</head>
<body>
<p>Trying to set cookie with value:</p><pre id='cookie_set'></pre>
<p>Your current non-HTTPOnly cookies are:</p><pre id='cookie_read'></pre>
<script>
// Try to set a cookie
var randVal = Math.random();
var set = document.getElementById('cookie_set');
set.innerHTML = randVal;
document.cookie = 'testPageCookie='+randVal;
// Get a cookie
var get = document.getElementById('cookie_read');
var cookies = document.cookie;
get.innerHTML = cookies;
</script>
</body>
</html>

0 comments on commit 74faad5

Please sign in to comment.
You can’t perform that action at this time.