Skip to content

Releases: expressjs/session

v1.19.0

22 Jan 14:45
c10b2a3

Choose a tag to compare

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.

    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...v1.19.0

v1.18.2

17 Jul 17:52
d10709f

Choose a tag to compare

What's Changed

New Contributors

Full Changelog: v1.18.1...v1.18.2

1.18.1

08 Oct 19:55
bbeca94

Choose a tag to compare

What's Changed

New Contributors

Full Changelog: v1.18.0...v1.18.1

1.18.0

28 Jan 21:21

Choose a tag to compare

  • Add debug log for pathname mismatch
  • Add partitioned to cookie options
  • Add priority to cookie options
  • Fix handling errors from setting cookie
  • Support any type in secret that crypto.createHmac supports
  • deps: cookie@0.6.0
    • Fix expires option to reject invalid dates
    • perf: improve default decode speed
    • perf: remove slow string split in parse
  • deps: cookie-signature@1.0.7

1.17.3

11 May 18:51

Choose a tag to compare

  • Fix resaving already-saved new session at end of request
  • deps: cookie@0.4.2

1.17.2

19 May 17:34

Choose a tag to compare

  • Fix res.end patch to always commit headers
  • deps: cookie@0.4.1
  • deps: safe-buffer@5.2.1

1.17.1

17 Apr 05:14

Choose a tag to compare

  • Fix internal method wrapping error on failed reloads

1.17.0

11 Oct 03:00

Choose a tag to compare

  • deps: cookie@0.4.0
    • Add SameSite=None support
  • deps: safe-buffer@5.2.0

1.16.2

12 Jun 05:02

Choose a tag to compare

  • Fix restoring cookie.originalMaxAge when store returns Date
  • deps: parseurl@~1.3.3

1.16.1

11 Apr 16:14

Choose a tag to compare

  • Fix error passing data option to Cookie constructor
  • Fix uncaught error from bad session data