-
-
Notifications
You must be signed in to change notification settings - Fork 992
Closed
Labels
Description
I created a simple Node app with the default MemoryStore. I configured the options then tried to invoke a method from the store to see what happened (e.g store.all() ). But I got an error said the store is probably undefined. How do I invoke methods of the store ?
The config obj for the session:
const testStore = new MemoryStore()
export const serverSessOpts: SessionOptions = {
secret: "123abc",
name: "test_session",
store: testStore,
// store: default, use MemoryStore
cookie: {
maxAge: 50000,
sameSite: "lax",
secure: false
},
saveUninitialized: false,
resave: false
};Then I used it before my routes, so it should be working
app.use(session(serverSessOpts))
// --- Run server ---
app.use(serverRouter);Beginner trying to understand how to use this library. Hope to receive some answers. Thanks