Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
36 changes: 6 additions & 30 deletions HISTORY.md
Original file line number Diff line number Diff line change
@@ -1,33 +1,9 @@
# Unreleased changes

### 🚀 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
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

1.18.2 / 2025-07-17
==========
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -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": [
Expand Down