Answer the question
In order to leave comments, you need to log in
How to work with express-session on subdomains?
Good afternoon. There was a need to use the current user session on the subdomains of the site.
express-session is configured like this:
app.use(session({
secret: config.app.secret,
store: myStore,
resave: true,
proxy: true,
saveUninitialized: true,
cookie: {
expires: 18000000,
originalMaxAge: 18000000,
domain: ".domain.com"
},
maxAge: 18000000
}));
Answer the question
In order to leave comments, you need to log in
Hah, stupid mistake on my part, including the file where the sessions are located and the API was lower than the routing index, because of which the session was not accepted. Problem solved
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question