List Cookies in Javascript


/ Published in: JavaScript
Save to your folder(s)



Copy this code and paste it in your HTML
  1. function listCookies() {
  2. var theCookies = document.cookie.split(';');
  3. var aString = '';
  4. for (var i = 1 ; i <= theCookies.length; i++) {
  5. aString += i + ' ' + theCookies[i-1] + "\n";
  6. }
  7. return aString;
  8. }

URL: http://www.arachna.com/edu/tutorials/mini/cookies/javascript.html

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.