Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function deserialize(cookieString) {
- return cookieString
- .split('; ')
- .filter(Boolean)
- .reduce((acc, cur) => {
- const c = cur.match(/(^.*?)=(.*$)/);
- return { ...acc, [c[1]]: c[2] };
- }, {});
- }
- deserialize(document.cookie);
Add Comment
Please, Sign In to add comment