From 697f43514ded7e3d8705ea38ead89ea839ce80a0 Mon Sep 17 00:00:00 2001 From: Alex Errant <109672176+AlexErrant@users.noreply.github.com> Date: Tue, 29 Aug 2023 13:27:46 -0500 Subject: [PATCH] fix `destroySession` for cookies with `maxAge` (#1032) Co-authored-by: Ryan Carniato --- packages/start/session/cookieStorage.ts | 1 + packages/start/session/sessions.ts | 1 + 2 files changed, 2 insertions(+) diff --git a/packages/start/session/cookieStorage.ts b/packages/start/session/cookieStorage.ts index 3689da235..1a0d8ce9b 100644 --- a/packages/start/session/cookieStorage.ts +++ b/packages/start/session/cookieStorage.ts @@ -53,6 +53,7 @@ export const createCookieSessionStorageFactory = async destroySession(_session, options) { return cookie.serialize("", { ...options, + maxAge: undefined, expires: new Date(0) }); } diff --git a/packages/start/session/sessions.ts b/packages/start/session/sessions.ts index 457fb85bd..b99f736e6 100644 --- a/packages/start/session/sessions.ts +++ b/packages/start/session/sessions.ts @@ -253,6 +253,7 @@ export const createSessionStorageFactory = await deleteData(session.id); return cookie.serialize("", { ...options, + maxAge: undefined, expires: new Date(0) }); }