Skip to content

Instantly share code, notes, and snippets.

@stefano-bortolotti
Created October 28, 2013 22:15
Show Gist options
  • Save stefano-bortolotti/7205764 to your computer and use it in GitHub Desktop.
Save stefano-bortolotti/7205764 to your computer and use it in GitHub Desktop.
Clear all the cookies
function clearCookies() {
var c = document.cookie.split(";");
for ( var i = 0; i < c.length; i++ ) {
var e = c[i].indexOf('=');
var n = ( e > -1 ) ? c[i].substr(0, e) : c[i];
document.cookie = n + '=;expires=Thu, 01 Jan 1970 00:00:00 GMT';
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment