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.

Features

  • Works in all browsers and accepts any character
  • Heavily tested and has no dependency
  • Supports ES modules and supports AMD/CommonJS
  • RFC 6265 compliant, has an useful Wiki
  • Enables custom encoding/decoding
  • The default encoding/decoding strategy is meant to be interoperable

Project Samples

Project Activity

See All Activity >

License

MIT License

Follow JavaScript Cookie

JavaScript Cookie Web Site

Other Useful Business Software
Our Free Plans just got better! | Auth0 Icon
Our Free Plans just got better! | Auth0

With up to 25k MAUs and unlimited Okta connections, our Free Plan lets you focus on what you do best—building great apps.

You asked, we delivered! Auth0 is excited to expand our Free and Paid plans to include more options so you can focus on building, deploying, and scaling applications without having to worry about your security. Auth0 now, thank yourself later.
Try free now
Rate This Project
Login To Rate This Project

User Reviews

Be the first to post a review of JavaScript Cookie!

Additional Project Details

Programming Language

JavaScript

Related Categories

JavaScript Browser Extensions and Plugins

Registered

2021-03-11