Skip to content

Instantly share code, notes, and snippets.

@bgantick
Last active December 9, 2016 20:47
Show Gist options
  • Save bgantick/43616ffdf439d38f820a48e5330e07eb to your computer and use it in GitHub Desktop.
Save bgantick/43616ffdf439d38f820a48e5330e07eb to your computer and use it in GitHub Desktop.
Function to get specific cookie value (returns str)
function getCookieVal(name) {
var value = "; " + document.cookie;
var parts = value.split("; " + name + "=");
if (parts.length == 2) return parts.pop().split(";").shift();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment