Download Latest Version v1.19.0 source code.zip (50.6 kB)
Email in envelope

Get an email when there's a new version of express-session

Home / v1.19.0
Name Modified Size InfoDownloads / Week
Parent folder
README.md 2026-01-22 3.3 kB
v1.19.0 source code.tar.gz 2026-01-22 41.6 kB
v1.19.0 source code.zip 2026-01-22 50.6 kB
Totals: 3 Items   95.5 kB 4

What's Changed

Main Changes

  • Add dynamic cookie options support Cookie options can now be dynamic, allowing for more flexible and context-aware configuration based on each request. This feature enables programmatic modification of cookie attributes like secure, httpOnly, sameSite, maxAge, domain, and path based on session or request conditions.

    js var app = express() app.use(session({ secret: 'keyboard cat', resave: false, saveUninitialized: true, cookie: function (req) { var match = req.url.match(/^\/([^/]+)/); return { path: match ? '/' + match[1] : '/', httpOnly: true, secure: req.secure || false, maxAge: 60000 } } }))

  • Add sameSite 'auto' support for automatic SameSite attribute configuration Added sameSite: 'auto' option for cookie configuration that automatically sets SameSite=None for HTTPS and SameSite=Lax for HTTP connections, simplifying cookie handling across different environments.

  • deps: use tilde notation for dependencies

PRs

New Contributors

Full Changelog: https://github.com/expressjs/session/compare/v1.18.2...v1.19.0

Source: README.md, updated 2026-01-22