0

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.

listener
  • 47
  • 7
  • Is my question to hard, to complex or not understandable? I'm grateful for each hint. – listener Oct 09 '19 at 13:04
  • It is not so clear what you need to achieve. Can you please give more details about your technology stack and the feature you are trying to develop? The Session class in Parse Server is actually automatically populated eveytime that an user sign up or log in. – Davi Macêdo Oct 27 '19 at 06:16

0 Answers0