Skip to content

8.0.0

Compare
Choose a tag to compare
@vvo vvo released this 20 Nov 00:40
· 210 commits to main since this release

The v8 of iron-session focuses on reducing its API surface and bringing compatibility with the Next.js App Router.

As long as you make the required code changes, this upgrade will not disconnect your customers once deployed.

Instead of multiple opinionated wrappers (withIronSess..) There's now a single method to get sessions: getIronSession().
Use it like this:

import { getIronSession } from "iron-session";

const session = getIronSession(req, res, { password: "...", cookieName: "..." });

// or, in App Router:
const session = getIronSession(cookies(), { password: "...", cookieName: "..." });

Read more in the README: https://github.com/vvo/iron-session#usage.
Have a look at our new examples:

New features:

  • App Router compatibility
  • updateConfig method to change a session configuration for the next save() or destroy()
  • Single entry point, no more /next, /edge, ..

BREAKING CHANGES:

  • We've removed support for Node.js < 18
  • We've removed withIronSessionApiRoute, withIronSessionSsr, ironSession
  • added support

Gigantic thanks to:

DALL·E 2023-11-20 08 43 30 - A black and white banner with a background resembling a millimetric paper sheet, similar to a blueprint  The word v8 is prominently written in the c