Created
January 22, 2018 10:04
-
-
Save ferdiemmen/fe8ca10edcc73cd493bef5f558a9cfdf to your computer and use it in GitHub Desktop.
Cookies to object
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
let cookies = {}; | |
document.cookie.split(' ').map(x => x.replace(/;$/g, '').split('=')).map(x => { cookies[x[0]] = x[1]; return x; }); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment