Guest User

Untitled

a guest
Jun 24th, 2018
108
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.25 KB | None | 0 0
  1. function deserialize(cookieString) {
  2. return cookieString
  3. .split('; ')
  4. .filter(Boolean)
  5. .reduce((acc, cur) => {
  6. const c = cur.match(/(^.*?)=(.*$)/);
  7. return { ...acc, [c[1]]: c[2] };
  8. }, {});
  9. }
  10.  
  11. deserialize(document.cookie);
Add Comment
Please, Sign In to add comment