Skip to content

Instantly share code, notes, and snippets.

@ianaya89
Created December 29, 2014 19:58
Show Gist options
  • Save ianaya89/98ab10dceb1f905eb6bb to your computer and use it in GitHub Desktop.
Save ianaya89/98ab10dceb1f905eb6bb to your computer and use it in GitHub Desktop.
Shows all cookies stored in document.cookies in dev tools.
(function() {
window.getCookies = (function() {
var rawCookies = document.cookie.split(';'),
cookies = [],
parsedCookie = '';
rawCookies.forEach(function(cookie) {
parsedCookie = cookie.split('=');
cookies.push({
key: parsedCookie.shift(),
value: decodeURIComponent(parsedCookie.join('='))
});
});
console.table(cookies);
})();
})();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment