Universal-cookie
lastmod 2026-11-10created 2024-01-072 edits
universal-cookie is a JavaScript library that lets you read and write cookies with the same API in both the browser and a Node.js server. It handles document.cookie in the browser and the cookie string in the request header on the server, while providing common methods such as get, set, and remove. Unlike the browser-only js-cookie, it was designed with server-side rendering in mind, and react-cookie and universal-cookie-express are built on top of this library.
See also
- javascript
- Cookie
- js-cookie
- next-client-cookies (Nextjs)
- react-cookie (React)
- universal-cookie - Universal cookies for JavaScript
- universal-cookie-express - Hook cookies get/set on Express for server-rendering