ScottHamper / Cookies

JavaScript Client-Side Cookie Manipulation Library
The Unlicense
1.77k stars 169 forks source link

if my cookie value is '👽👽👽👽' will cause URIError: URI malformed #76

Closed linjieAda closed 2 years ago

ScottHamper commented 2 years ago

Hey @linjieAda ,

Cookie values must be URI encoded in order to comply with RFC6265. See the relevant section in the README:

Cookies.js also expects cookie keys and values to already be URI encoded in a UTF-8 representation when it accesses cookies. Keep this in mind when working with cookies on the server side.