From c903388f499d521c300edc66d64e184a270b9e29 Mon Sep 17 00:00:00 2001 From: Michael Bromley Date: Tue, 14 Nov 2023 11:45:25 +0100 Subject: [PATCH] feat(core): Accept `maxAge` and `expires` options in cookie config Closes #2518 --- packages/core/src/config/vendure-config.ts | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/packages/core/src/config/vendure-config.ts b/packages/core/src/config/vendure-config.ts index 64a7fad493..14a734e752 100644 --- a/packages/core/src/config/vendure-config.ts +++ b/packages/core/src/config/vendure-config.ts @@ -299,6 +299,22 @@ export interface CookieOptions { * the same request with the same name (regardless of path or domain) are filtered out of the Set-Cookie header when setting this cookie. */ overwrite?: boolean; + + /** + * @description + * A number representing the milliseconds from Date.now() for expiry + * + * @since 2.2.0 + */ + maxAge?: number; + + /** + * @description + * a Date object indicating the cookie's expiration date (expires at the end of session by default). + * + * @since 2.2.0 + */ + expires?: Date; } /**