cookietest.html

<!DOCTYPE html>
<html>
  <head>
    <title>Test of cookie lib</title>
    <meta charset="utf-8" />
    <script src="cookielib.js"></script>
  </head>
  <body>
<h1>Cookie test</h1>
<script>
  // Set some cookies
  setCookie("cookie1","value1");
  setCookie("cookie2","value2",3600); //expires in 1 hour
  setCookie("cookie3","value3");

  // Look at the cookie string.  Note, may contain other cookies valid for domain
  document.write("<br>document.cookie: ");
  document.write(document.cookie);

  // Get each cookie value
  document.write("<br>cookie1: ");
  document.write(getCookie("cookie1"));

  document.write("<br>cookie2: ");
  document.write(getCookie("cookie2"));

  document.write("<br>cookie3: ");
  document.write(getCookie("cookie3"));

  // Delete a cookie
  document.write("<br>Deleting cookie3");
  delCookie("cookie3");
  document.write("<br>document.cookie: ");
  document.write(document.cookie);

  // Suggest now look at your cookies in browser.  In firefox, open Preferences,
  // Privacy tab, with "Remember history" selected click "remove individual cookies".
</script>
  </body>
</html>