Skip to content

Commit

Permalink
Partitioned Bis
Browse files Browse the repository at this point in the history
  • Loading branch information
nicob-29 committed Dec 4, 2023
1 parent 25b4f6b commit 2744c31
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 2 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@ The options object is used to generate the `Set-Cookie` header of the session co
* `expires` - The expiration `date` used for the `Expires` attribute. If both `expires` and `maxAge` are set, then `maxAge` is used.
* `sameSite`- The `boolean` or `string` of the `SameSite` attribute. Using `Secure` mode with `auto` attribute will change the behavior of the `SameSite` attribute in `http` mode. The `SameSite` attribute will automatically be set to `Lax` with an `http` request. See this [link](https://www.chromium.org/updates/same-site).
* `domain` - The `Domain` attribute.
* `partitioned`- The `boolean` value of the `Partitioned` attribute. Using the Partitioned attribute as part of Cookies Having Independent Partitioned State (CHIPS) to allow cross-site access with a separate cookie used per site.Defaults to false.

##### store
A session store. Needs the following methods:
Expand Down
4 changes: 3 additions & 1 deletion lib/cookie.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ module.exports = class Cookie {
this.sameSite = cookie.sameSite || null
this.domain = cookie.domain || null
this.httpOnly = cookie.httpOnly !== undefined ? cookie.httpOnly : true
this.partitioned = cookie.partitioned ?? null
this._expires = null

if (originalMaxAge) {
Expand Down Expand Up @@ -61,7 +62,8 @@ module.exports = class Cookie {
secure: this.secure,
path: this.path,
httpOnly: this.httpOnly,
domain: this.domain
domain: this.domain,
partitioned: this.partitioned
}
}
}
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@fastify/session",
"version": "10.6.1",
"version": "10.6.2",
"description": "a session plugin for fastify",
"main": "lib/fastifySession.js",
"type": "commonjs",
Expand Down

0 comments on commit 2744c31

Please sign in to comment.