Elestia Open Source Ratings
6.8

iron-session

Reasonable, with limits. 4th of 10 authentication libraries.

iron-session is a small library that stores session data in encrypted, signed cookies. It works with Next.js (App Router, Proxy), Express and web-standard runtimes. It is well kept and safe, and the Next.js docs recommend it. It only handles sessions, though: you build sign-in, OAuth and user storage yourself, or pick a full library such as Better Auth.

Best for: Teams that already handle sign-in themselves and want simple, database-free encrypted cookie sessions, especially in Next.js.

WebsiteGitHubnpm

Scores

Overall6.8

How strongly do we recommend it for a new project today?

Claude Opus 5.5: 6.5, likely 5.5 to 7.5

It is the best simple choice for encrypted cookie sessions when you own the sign-in logic, and it is maintained, safe and recommended by Next.js. For most new apps that need full authentication, Better Auth or Auth.js do more of the job, so it ranks below them for the category as a whole. The range is wide because the score depends on whether you need only sessions.

GPT-6.2 Sol: 7.1, likely 6.0 to 8.2

Pick iron-session when the app already handles identity and needs encrypted cookie sessions without a session database. Better Auth is the stronger default when a new project also needs sign-in, account management, and immediate session revocation. Fresh releases and framework guidance support adopting v9.1, while concentrated release ownership and limited independent production evidence for v9 keep the range open.

Needed by many4.8

How many developers need a tool for this job?

Claude Opus 5.5: 5.0, likely 4.0 to 6.0

Most server-rendered web apps need sessions, but this project covers only that part of the auth job. Its users are mostly people who write their own sign-in, often in Next.js. Recent adapters for web-standard runtimes widen it beyond Next.js.

GPT-6.2 Sol: 4.5, likely 3.4 to 5.7

Keeping users signed in is common in web apps, and the cookie adapters work across frameworks and runtimes. The fit narrows to apps that want stateless browser sessions and already have a way to sign users in. Framework surveys show the size of the surrounding ecosystem, while demand for standalone cookie sessions is harder to measure.

Helps a lot7.3

How well does it do the job for those who need it?

Claude Opus 5.5: 7.0, likely 6.0 to 8.0

It does cookie sessions well. v9 brought Proxy support, chunked cookies, better types, onUnsealError and fixes for silent session bugs, and its cookies work with v8 in both directions. It scores below full libraries because it leaves sign-in, revocation and user management to you. Its small, stable API is easy for AI agents to write correctly.

GPT-6.2 Sol: 7.6, likely 6.5 to 8.7

Version 9.1 reads sessions without a network call and gives developers typed adapters, rejection diagnostics, and examples for common frameworks. Version 9 fixed a reported Next.js middleware write problem, and 9.1 corrected expiry handling for browser-session cookies. Applications still own refresh logic and immediate revocation. The small API and documented examples give coding agents a clear starting point, though independent measurements of v9 performance and agent accuracy are sparse.

Holds up over time6.8

Will it still be a good choice in two years?

Claude Opus 5.5: 7.0, likely 5.5 to 8.0

The project is active, with v9.0 in August 2026 and v9.1 in November 2026. It has 6 releases and 31 commits in the last year, and only 2 issues and 1 PR are open. The risk is one owner with little outside funding. The v9 ESM-only and Node 22 change is a real break, though it was handled carefully with cookie compatibility in both directions.

  • github releasesLastYear / commitsLastYear: 6 releases, 31 commits
  • github openIssues / closedIssues: 2 open versus 227 closed
  • github.com/vvo/iron-session/releases: v9 breaking changes with a documented upgrade path
  • scorecard Maintained: Score 10

GPT-6.2 Sol: 6.5, likely 5.2 to 7.7

The project recorded 31 commits and six GitHub releases in the past year, including prereleases, with v9.1 shipped in November. The v9 upgrade raised the Node minimum and changed how session data is typed, while keeping v8 cookies readable in both directions for rollback. A reported middleware issue took nearly nine months to reach a fix, and one maintainer controls releases. The project lists sponsorship, while funding continuity and release succession are unclear.

Used widely4.7

How many use it, and is that growing?

Claude Opus 5.5: 5.0, likely 4.0 to 6.0

Downloads were 14.5M in the last 4 weeks, against 2.3M a year earlier. That ratio of 6.3 is above the median of 4.1, so it is gaining ground. Part of the download count likely comes from packages that install it, such as auth wrappers. 900 dependent repos is modest next to Auth.js (19,200) and Passport, and Bluesky and Hacker News attention is minimal.

GPT-6.2 Sol: 4.4, likely 3.2 to 5.7

Four-week downloads rose from 2.30 million to 14.54 million, or 6.33 times the prior year, above the catalog median of 4.1. The index found 900 dependent repositories and 39 packages, fewer than Auth.js's 19,200 repositories and more than SuperTokens's 597. Its 4,155 stars and three Bluesky posts show modest attention beside the category leaders. Build installs and indirect use through packages such as AuthKit make it hard to tell how much of the growth came from teams choosing iron-session directly.

  • npm.downloadsLast4Weeks, npm.downloadsSame4WeeksYearAgo, medianDownloadsRatio: 6.33 times year-over-year growth against a 4.1 catalog median.
  • dependents, peers: 900 indexed repositories and 39 packages, with much wider indexed use for Auth.js.
  • github.stars, bluesky.posts, peers: 4,155 stars and three posts, versus 30,800 stars and 18 posts for Better Auth.
  • github.com/workos/authkit-nextjs/blob/main/package.json: AuthKit installs iron-session as a runtime dependency.
Vouched for6.5

Who stands behind it being good?

Claude Opus 5.5: 6.0, likely 4.5 to 7.0

Its main endorsement is current: the official Next.js authentication guide lists it next to jose as a recommended session library. Small libraries such as ideal-auth and Iron Auth build on it. I found no developer survey data, independent benchmarks or named large production users.

GPT-6.2 Sol: 6.9, likely 5.7 to 8.0

Next.js recommends iron-session for session management, and TanStack Start demonstrates the v9 adapter in its authentication guide. WorkOS uses v8 in its Next.js AuthKit SDK, and an independent hands-on comparison exercised that integration. Those sources support the cookie-session use case, with more limited independent evidence for v9.1 in production or its performance against peers.

Safe7.8

How safe is it to depend on?

Claude Opus 5.5: 8.0, likely 7.0 to 9.0

It has no advisories ever, two runtime dependencies built on the proven @hapi/iron design via iron-webcrypto, and an MIT licence. Releases now go out from CI with npm provenance. The Scorecard is 6.8: code review, SAST and fuzzing score 0, which fits a single-maintainer project.

  • advisories total: 0 advisories
  • npm dependencies: 2 dependencies
  • scorecard: 6.8 overall; Code-Review 0, SAST 0, Fuzzing 0
  • github.com/vvo/iron-session/releases: v9.0.1 republished from CI with provenance

GPT-6.2 Sol: 7.5, likely 6.3 to 8.6

The MIT package has two runtime dependencies, secure cookie defaults, and zero advisories in the supplied OSV snapshot. The v9.0.0 publish lacked provenance, and v9.0.1 republished the same code from CI with provenance that day. The v9.1 release workflow checks for a provenance record, and one maintainer controls releases. OpenSSF's 6.8 score includes zeroes for code review, fuzzing, and static analysis, which limits confidence in how consistently issues would be caught.

Good

  • The API is tiny: one getIronSession() call, with adapters for App Router, Next.js Proxy, Express, Hono, Bun, Deno and Workers.
  • Sessions need no database or session store, with key rotation and optional chunking for data over 4 KB.
  • It has no known advisories, only two runtime dependencies, and releases are published from CI with npm provenance since v9.0.1.
  • The official Next.js authentication guide names it as one of two recommended session libraries.

Bad

  • It does not sign users in: no OAuth providers, passwords, MFA or user tables, which Better Auth or Auth.js provide.
  • Stateless cookies cannot be revoked on the server, so 'log out all devices' needs extra work.
  • v9 is ESM-only and needs Node 22.13+, so older projects must stay on v8.
  • One owner does most of the work, and the Scorecard shows no code review on changes.

The numbers

npm downloads, 4 weeks
15M ×6.3 in a year
GitHub stars
4.2k
Commits, 12 months
31
npm version
9.1.0 Nov 2026
Versions, 12 months
3
Advisories, 24 months
0 of 0 ever
OpenSSF Scorecard
6.8 out of 10, Nov 2026
Licence
MIT

Read on 21 November 2026 from GitHub (vvo/iron-session), npm (iron-session), OSV and the OpenSSF Scorecard.

Authentication libraries

  1. 8.5Better Auth
  2. 8.3jose
  3. 7.9openid-client
  4. 6.8iron-session
  5. 6.3SuperTokens
  6. 5.2jsonwebtoken
  7. 4.9Passport
  8. 4.0Auth.js
  9. 1.6Arctic
  10. 1.6Lucia
Compare all 10 on six scores