Skip to content

Instantly share code, notes, and snippets.

@asruldev
Created April 12, 2020 18:07
Show Gist options
  • Save asruldev/775b76e917d0314b9b77992b69aa3646 to your computer and use it in GitHub Desktop.
Save asruldev/775b76e917d0314b9b77992b69aa3646 to your computer and use it in GitHub Desktop.
Cara ambil data dari cookie berdasarkan nama cookie
function checkCookieName(name) {
const match = document.cookie.match(new RegExp('(^| )' + name + '=([^;]+)'));
if (match) {
return match[2];
} else {
return false
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment