Skip to content

Instantly share code, notes, and snippets.

@estorgio
Last active January 27, 2019 18:04
Show Gist options
  • Save estorgio/7143bec84a7b796e548c366a4f6f55d4 to your computer and use it in GitHub Desktop.
Save estorgio/7143bec84a7b796e548c366a4f6f55d4 to your computer and use it in GitHub Desktop.
Get all cookies in a page
document.cookie.split(';').map(entry => {
const key = entry.slice(0, entry.indexOf('=')).trim();
const value = entry.slice(entry.indexOf('=') + 1).trim();
return {
[key]: value
};
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment