Skip to content

How do I invoke methods of the store ? #915

@phquang98

Description

@phquang98

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 ?
11

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions