Created
September 20, 2020 12:55
-
-
Save rubinchyk/607ba7c5922e46a84a81be05a2fb768b to your computer and use it in GitHub Desktop.
[Read cookies] Read cookies
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
function readCookies(cookie) { | |
const cookies = cookie.replaceAll("; ", "&"); | |
const params = new URLSearchParams(cookies); | |
return Object.fromEntries(params.entries()); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment