dimanche 24 octobre 2021

NodeJS express-session, if cookie path is set, cookie doesn't save

(I don't know a lot about web development)

I have a web page with passport login and express session.

Everything works but the cookie and I noticed what was the problem ( if i define the path of the cookie, the cookie doesn't add to the domain. )

If anyone knows why it happens please tell me.

(session store: connect-mongo 4.6.0)

app.use(session({ secret: 'secret', store: Store.create({ mongoUrl: 'myMongoURL', dbName: 'db-sessions' }), cookie: { path: '/menu', domain: 'mydomain.com', maxAge: 60000 * 60 * 24, }, resave: false, saveUninitialized: false,

}))




Aucun commentaire:

Enregistrer un commentaire