Skip to content

Conversation

@UlisesGascon
Copy link
Member

Milestone details: https://github.com/expressjs/session/milestone/3
cc: @expressjs/express-tc

What's included in the HISTORY.md

1.19.0 / 2026-01-22
==========

  * Add dynamic cookie options support
  * Add sameSite 'auto' support for automatic SameSite attribute configuration
  * deps: use tilde notation for dependencies

What's Changed

This will be included in the release details

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.

    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: v1.18.2...master

@UlisesGascon UlisesGascon self-assigned this Jan 19, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant