Skip to content

Instantly share code, notes, and snippets.

@headquarters
Created January 27, 2020 13:08
Show Gist options
  • Select an option

  • Save headquarters/2e61252ebe8482cfa1290dc455b1dba4 to your computer and use it in GitHub Desktop.

Select an option

Save headquarters/2e61252ebe8482cfa1290dc455b1dba4 to your computer and use it in GitHub Desktop.
Delete cookies via the console
var cookies = decodeURIComponent(document.cookie).split("; "); for (var c in cookies) { var values = cookies[c].split("="); document.cookie = encodeURIComponent(values[0]) + "=" + encodeURIComponent(values[1]) + "; max-age=-1"; }
@headquarters
Copy link
Author

Bookmarklet form:

javascript:(function()%7Bvar%20cookies%20%3D%20decodeURIComponent(document.cookie).split(%22%3B%20%22)%3B%20for%20(var%20c%20in%20cookies)%20%7B%20var%20values%20%3D%20cookies%5Bc%5D.split(%22%3D%22)%3B%20document.cookie%20%3D%20encodeURIComponent(values%5B0%5D)%20%2B%20%22%3D%22%20%2B%20encodeURIComponent(values%5B1%5D)%20%2B%20%22%3B%20max-age%3D-1%22%3B%20%7D%7D)()%3B

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment