diff --git a/app/modules/theme/session.server.ts b/app/modules/theme/session.server.ts index 0311135d9..65e86d62c 100644 --- a/app/modules/theme/session.server.ts +++ b/app/modules/theme/session.server.ts @@ -4,6 +4,8 @@ import { isTheme } from "./provider"; import type { Theme } from "./provider"; import invariant from "tiny-invariant"; +const TEN_YEARS_IN_SECONDS = 315_360_000; + if (process.env.NODE_ENV === "production") { invariant(process.env["SESSION_SECRET"], "SESSION_SECRET is required"); } @@ -17,6 +19,7 @@ const themeStorage = createCookieSessionStorage({ sameSite: "lax", path: "/", httpOnly: true, + maxAge: TEN_YEARS_IN_SECONDS, }, });