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

You Might Also Like
Run applications fast and securely in a fully managed environment Icon
Run applications fast and securely in a fully managed environment

Cloud Run is a fully-managed compute platform that lets you run your code in a container directly on top of scalable infrastructure.

Run frontend and backend services, batch jobs, deploy websites and applications, and queue processing workloads without the need to manage infrastructure.
Try for free
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