Download Latest Version 8.0.1 source code.tar.gz (2.3 MB)
Email in envelope

Get an email when there's a new version of Iron-Session

Home / v8.0.0
Name Modified Size InfoDownloads / Week
Parent folder
8.0.0 source code.tar.gz 2023-11-20 126.9 kB
8.0.0 source code.zip 2023-11-20 149.5 kB
README.md 2023-11-20 1.7 kB
Totals: 3 Items   278.1 kB 0

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:

:::js
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: - @brc-dd for creating https://github.com/brc-dd/iron-webcrypto, doing most of the work of the b8 branch and being of great help while designing the API! - @renchris for making the adapter to support server components, server actions and route handlers.

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

Source: README.md, updated 2023-11-20