Answer the question
In order to leave comments, you need to log in
How to use your Mongoose storage for sessions?
How to use your Mongoose storage for sessions?
To insert and validate data yourself.
So far, based on all sorts of manuals, I wrote this:
let session = require("express-session");
let MongoStore = require("connect-mongo")(session);
app.use(session({
secret: "secret",
name: "name",
cookie: {
path: "/",
"httpOnly": true,
saveUnitialized: true,
}
resave: true,
saveUnitialized; true,
stroe: new MongoStore({mongooseConnection: connection})
}));
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question