Description
iron-session is a secure, stateless, cookie-based session library for JavaScript, made for Next.js and other frameworks. Session data is stored in signed and encrypted cookies, which your server code decodes without any network call. The README says this is the same technique Ruby on Rails uses. The documentation covers installation, usage, examples, supported runtimes and session size, along with watching for unreadable cookies and validating session data. It describes the session options and the API, including getIronSession for request-based and cookie-store setups, the save, destroy and updateConfig session methods, and the sealData and unsealData helpers. An FAQ answers why pure cookies are used, how to invalidate sessions and how it differs from JWT. Version 9 needs Node 22.13 or later and is ESM-only, and the README tells users on older Node versions to stay on version 8. The library is featured in the Next.js documentation, and there is an online demo.…
Highlights
- Signed and encrypted cookie sessions
- Stateless, with no network call to decode a session
- Works with Next.js and other JavaScript frameworks
- Version 9 is ESM-only and needs Node 22.13+
Ratings & Reviews
No ratings yet
Be the first to rate iron-session.
People also visit
iron-session FAQ
What is iron-session?
A secure, stateless, cookie-based session library for JavaScript, used with Next.js and other frameworks.
How does it store sessions?
In signed and encrypted cookies, which the server decodes statelessly without a database or a network call.
Which Node.js version does v9 need?
Node 22.13 or later. v9 is ESM-only, and the README says to stay on v8 if you are on an older Node.
Where is the source?
On GitHub at vvo/iron-session.
What are the best iron-session alternatives?
Popular alternatives to iron-session include @deemlol/next-icons, @daveyplate/better-auth-ui and react-oidc-context. See all iron-session alternatives













