Course map
Stage 1: App Router Foundations
Stage 2: The Rendering Model
Stage 3: Data, Caching and Mutations
Stage 4: Full-Stack Next.js
Stage 5: Production and Specialization

Part 15 / Topic 1 of 5

Library choice: iron-session, chosen the same way better-sqlite3 was

DESIGN-NOTES.md already set this course's precedent for picking a dependency: check whether its latest npm dist-tag is a genuinely stable, current release, not a project mid-churn. The same check, run for this part:

Package latest dist-tag resolved to Note
iron-session 9.1.1 Stable, released 2026-11-23 — eight days before this part was written. No external service, no account, no API key; a pure cookie-sealing library that runs entirely inside this process.
next-auth 4.24.15 latest is an old major; the 5.0.0-beta.32 tag is still a beta after years of development — the same mid-churn signature DESIGN-NOTES.md already used to reject Prisma for Part 16
lucia 3.2.2, but deprecated npm view lucia deprecated returns a real deprecation notice pointing at a migration guide — its own author stopped maintaining it

This isn't a preference call — the installed Next.js docs make the same choice directly. The authentication.md guide's own "Session Management Libraries" list names exactly two: iron-session and Jose. Its full "Auth Libraries" list (Auth0, Clerk, NextAuth.js, WorkOS, Supabase, ...) is explicitly the other category — every one of them either needs an external account/API key (ruling them out for this course's "works fully offline" requirement) or, in NextAuth's specific case, has exactly the version-churn problem above. The installed authentication-with-cache-components.md guide goes one step further and uses iron-session as its own worked example for the Cache Components-specific pattern this part needs ("use cache: private", section 4) — this part follows that exact guide, swapping its hand-rolled jose sketch for the real library it names. iron-session was installed for real (npm install iron-session, resolving to 9.1.1, 0 vulnerabilities) and every example below was actually run against this harness — nothing in this part is "documented but not run."

Done here? The practice set for Part 15 — including the solutions — is on the part page.

Search the guide