From 2744c31b7535fa86448e9b71e04127238c796d00 Mon Sep 17 00:00:00 2001 From: Nicolas Bertrand Date: Mon, 4 Dec 2023 18:22:22 +0100 Subject: [PATCH] Partitioned Bis --- README.md | 1 + lib/cookie.js | 4 +++- package.json | 2 +- 3 files changed, 5 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 30b78a2..3a189bd 100644 --- a/README.md +++ b/README.md @@ -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: diff --git a/lib/cookie.js b/lib/cookie.js index d157bd6..0c4fa01 100644 --- a/lib/cookie.js +++ b/lib/cookie.js @@ -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) { @@ -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 } } } diff --git a/package.json b/package.json index 67374a3..abf97a5 100644 --- a/package.json +++ b/package.json @@ -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",