This is my first web development and my first use of a database.
With help of this Q&A I understand the purpose of sessions.
Up to now I have used 'express-session'.
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."
Another Q&A gave me an impression of the problem. Now I'm confused about the class Session in my back4app database. I guess, I should have used them instead of the server memory. But how? I was looking for a simple, straightforward example and have found nothing.
Could you provide an example please? The Parse Doc is not enough for me. A coded, running example would be very helpful.