Deleting Cookies
-
Hi guys,
The password-protected pages and posts have a, hm, feature that I wanted to disable. When somebody puts the password in, sees the page, closes the browser and walks away (and the browser is not set to forget cookies right away), anyone can see the password-protected page, because the cookie is still there. So I was wondering: how can I make a link so the person can click on it and have his/her cookies erased automatically? I tried inputting this bookmarklet javascript…
javascript:(function(){C=document.cookie.split(";%20");for(d="."+location.host;d;d=(""+d).substr(1).match(/\..*$/))for(sl=0;sl<2;++sl)for(p="/"+location.pathname;p;p=p.substring(0,p.lastIndexOf('/')))for(i%20in%20C)if(c=C[i]){document.cookie=c+";%20domain="+d.slice(sl)+";%20path="+p.slice(1)+"/"+";%20expires="+new%20Date((new%20Date).getTime()-1e11).toGMTString()}})()
… code into html, but this hasn’t worked out. If you have any ideas, I’d appreciate it very much, I honestly don’t know what’s wrong with the method.
Thanks in advance!
- The topic ‘Deleting Cookies’ is closed to new replies.