GitHub 6219★

Convert cookie to object

JavaScript version

const cookies = document.cookie
.split(';')
.map((item) => item.split('='))
.reduce((acc, [k, v]) => (acc[k.trim().replace('"', '')] = v) && acc, {});
Follow me on and to get more useful contents.