How can I create and read a value from a cookie in JavaScript?
Simple way to read cookies in ES6.
function getCookies() { var cookies = {}; for (let cookie of document.cookie.split('; ')) { let [name, value] = cookie.split("="); cookies[name] = decodeURIComponent(value); } console.dir(cookies); }