This commit is contained in:
Ulises Gascón
2026-01-22 15:44:27 +01:00
committed by GitHub
parent 00819ea8b5
commit d3c12c9391
2 changed files with 6 additions and 30 deletions
+5 -29
View File
@@ -1,33 +1,9 @@
# Unreleased changes
1.19.0 / 2026-01-22
==========
### 🚀 Improvements
* 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
* Add dynamic cookie options support
* Add sameSite 'auto' support for automatic SameSite attribute configuration
* deps: use tilde notation for dependencies
1.18.2 / 2025-07-17
==========
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "express-session",
"version": "1.18.2",
"version": "1.19.0",
"description": "Simple session middleware for Express",
"author": "TJ Holowaychuk <[email protected]> (http://tjholowaychuk.com)",
"contributors": [