From 013319d7a4651d1708280f556e39c2f03839426a Mon Sep 17 00:00:00 2001 From: Maks Jopek Date: Sun, 25 Apr 2021 12:07:36 +0200 Subject: Almost going in a circle --- backend/ts/index.ts | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'backend/ts/index.ts') diff --git a/backend/ts/index.ts b/backend/ts/index.ts index e4ec5ee..32ac644 100644 --- a/backend/ts/index.ts +++ b/backend/ts/index.ts @@ -17,7 +17,14 @@ const PORT = 8000; if (!process.env.SESSION_KEY) throw Error("SESSION_KEY is undefined"); -app.use(session({ secret: process.env.SESSION_KEY, cookie: { maxAge: 60000 } })); +app.use(session({ + secret: process.env.SESSION_KEY, + saveUninitialized: true, + resave: true, + cookie: { + expires: new Date(Date.now() + 3600000), + } +})); app.use(express.json()); app.use("/", express.static("./public")); -- cgit v1.3.1