Skip to content

Instantly share code, notes, and snippets.

@ovcharik
Last active August 29, 2015 14:06
Show Gist options
  • Save ovcharik/c0eef241b0f40072cda5 to your computer and use it in GitHub Desktop.
Save ovcharik/c0eef241b0f40072cda5 to your computer and use it in GitHub Desktop.
Parse cookies
document.cookie.split(";").map(function(s){return s.trim().split("=")}).reduce(function(p,c){c[0]&&(p[c[0]]=c[1]);return p;},{})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment