A simple, lightweight JavaScript API for handling cookies which works in all browsers and accepts any character. It is heavily tested, has no dependency, supports ES modules and supports AMD/CommonJS. It is RFC 6265 compliant, has an useful Wiki, and enables custom encoding/decoding. More than 800 bytes gzipped! This project is RFC 6265 compliant. All special characters that are not allowed in the cookie-name or cookie-value are encoded with each one's UTF-8 Hex equivalent using percent-encoding.
The only character in cookie-name or cookie-value that is allowed and still encoded is the percent % character, it is escaped in order to interpret percent input as literal. Please note that the default encoding/decoding strategy is meant to be interoperable only between cookies that are read/written by js-cookie. To override the default encoding/decoding strategy you need to use a converter.