That's my code:
const session = require('express-session');
let sess = {
//store: ,
secret: cryptoString,
resave: true,
saveUninitialized: true,
cookie: {
path: '/',
maxAge: 8 * 60 * 60 * 1000, //h * min * s * ms
},
name: 'data',
}
server.use(session(sess));
server.post('/lgn', (req, resp) => {
let session = req.session;
});
I have uploaded my code to heroku and it works. But I get the warning:
"connect.session() MemoryStore is not designed for a production enviroment, as it will leak memory, and will not scale past a single process."
After lots of research I have figured out, that I have to use a store. But which one? I was experimenting with mongo-connect. But without success.
That's what I have added in my code:
const MongoStore = require('connect-mongo')(session);
let sess = {
//store: new MongoStore(options), //what are the options for back4app?
...
}
I don't understand, how to implement it correct and even if it is the right store for back4app? Who has experience with integrating the back4app session in express-session?