I'm trying to share the same session cookie across two express.js apps. I'm setting the same secret and same key id on both app configurations. Then I have them running on the same domain (different ports).
Both apps have the following in app.js:
app.use(express.cookieParser());
app.use(express.session({
store: db.sessionStore,
secret: 'samesecretforall',
key: 'express.sid',
cookie: {
maxAge: null,
path: "/",
domain: ".localhost"
}
}));
In theory they should share the same value for the session cookie right? What I'm seeing is that the value of the cookie "express.sid" changes as soon as I switch between my apps.
Am I missing something?