Set cookie for domain instead of subDomain using NodeJS and ExpressJS Set cookie for domain instead of subDomain using NodeJS and ExpressJS express express

Set cookie for domain instead of subDomain using NodeJS and ExpressJS


configure it like this:

app.use(express.session({    secret: conf.secret,    cookie: { domain:'.yourdomain.com'},    store: new MongoStore(conf.sessiondb)}));


Try to use the following link to configure.

res.cookie('name', 'tobi', { domain: '.example.com', path: '/admin', secure: true });

Link : http://expressjs.com/api.html#res.cookie