Last active
December 21, 2015 10:29
-
-
Save davidlonjon/6292051 to your computer and use it in GitHub Desktop.
JavaScript: Get Cookie
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
getCookie = function(cookieName) { | |
var r = document.cookie.match("\\b" + cookieName + "=([^;]*)\\b"); | |
return r ? r[1] : undefined; | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment