anonymous function to unset a cookie


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



Copy this code and paste it in your HTML
  1. // unset cookie
  2. function(name){
  3. return function(expires) {
  4. return document.cookie = escape(name) + '=' + expires + '; path=/';
  5. }((function(d){
  6. d.setTime(d.getTime() + (86400000 * -1));
  7. return '; expires=' + d.toGMTString();
  8. }(new Date())));
  9. }('name-of-cookie');
  10.  

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.