Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- javascript: var numCookies = 0;
- var cookieArray = document.cookie.split("; ");
- for (var i = 0; i < cookieArray.length && cookieArray[i]; i++) {
- numCookies++;
- for (var subDomain = "." + location.host; subDomain; subDomain = subDomain.replace(/^(?:%5C.|[^%5C.]+)/, "")) {
- for (var curPath = location.pathname; curPath; curPath = curPath.replace(/.$/, "")) {
- document.cookie = (cookieArray[i] + "; domain=" + subDomain + "; path=" + curPath + "; expires=" + new Date((new Date()).getTime() - 1e11).toGMTString());
- }
- }
- }
- alert("All data, including" + numCookies + " cookies cleared. Click OK to reload page :)");
- window.location.href = "http://" + window.location.host + window.location.pathname;
- (function() {
- localStorage.clear();
- var c = document.cookie.split("; ");
- for (i in c) {
- document.cookie = /^[^=]+/.exec(c[i])[0] + "=;expires=Thu, 01 Jan 1970 00:00:00 GMT";
- };
- })();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement