js-cookie
js-cookie
A tiny, mainstream JS library to simplify managing cookies from client-side javascript
js-cookie.js
The vanilla JavaScript interface for working with cookies is cumbersome and error-prone. js-cookie.js is a tiny, mainstream library that simplifies managing cookies from client-side JavaScript.
We've long used the jQuery Cookie plugin, but that's been end-of-lifed since late 2017. That plugin didn't actually rely on jQuery, but simply used it as a namespace in the global context. If you need to work with cookies from client-side javsacript, js-cookie is the preferred library.
You can find the usage detils on the project's github page: