Skip to content

Instantly share code, notes, and snippets.

@sooop
Last active February 24, 2016 07:41
Show Gist options
  • Save sooop/6413723 to your computer and use it in GitHub Desktop.
Save sooop/6413723 to your computer and use it in GitHub Desktop.
clear all cookies : 모든 쿠키 삭제하기
;(function(){
var ok = confirm("Clear All Cookies, proceed?");
if(ok) clearCookies();
function clearCookies ()
{
var a,b,c,d,e,f,g;
a = document.cookie.split(';').map(function(e){return e.trim();});
g = new Date(new Date().getTime() - 1e11).toUTCString();
for(b=0;b<a.length;b++) {
c = document.location.hostname;
d = /^(\.|[^\.]+)/;
while(c.length>0) {
e = document.location.pathname;
f = /(\/|[^\/\+])$/;
while(e.length > 0) {
document.cookie = a[b]+"; domain="+c+"; path="+e+"; expires="+g;
e = e.replace(f, "");
}
c = c.replace(d,"");
}
}
}
})();
/*
//javascript:;(function(){var ok = confirm("Clear All Cookies, proceed?"); if(ok) clearCookies(); function clearCookies () {var a,b,c,d,e,f,g; a = document.cookie.split(';').map(function(e){return e.trim();}); g = new Date(new Date().getTime() - 1e11).toUTCString(); for(b=0;b<a.length;b++) {c = document.location.hostname; d = /^(\.|[^\.]+)/; while(c.length>0) {e = document.location.pathname; f = /(\/|[^\/\+])$/; while(e.length > 0) {document.cookie = a[b]+"; domain="+c+"; path="+e+"; expires="+g; e = e.replace(f, ""); } c = c.replace(d,""); } } } })(); */
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment