I am using mongoStore to manage session on express.js framework.
...
var MongoStore = require('connect-mongo')(express);
...
...
app.use(express.session({
secret:settings.cookieSecret,
store: new MongoStore({db:settings.db})
}));
...
but here is the record in sessions collection on mongoDB
> db.session
s.find()
{ "_id" : "gLQe0NwaSmk9nPu6vOWKuSy0", "session" : "{\"cookie\":{\"originalMaxAge\":null,\"expires\":null,\"httpOnly\":true,\"path\":\"/\"},\"flash\":{},\"user\":null}", "expires" : ISODate("2013-12-24T05:02:33.308Z") }
{ "_id" : "SoqYLZnEzlVCdj4A1606fDPg", "session" : "{\"cookie\":{\"originalMaxAge\":null,\"expires\":null,\"httpOnly\":true,\"path\":\"/\"},\"flash\":{},\"user\":\"vvv\"}", "expires" : ISODate("2013-12-24T09:43:55.098Z") }
{ "_id" : "pBtoFt6sR2EvNCuPJVqAFVpR", "session" : "{\"cookie\":{\"originalMaxAge\":null,\"expires\":null,\"httpOnly\":true,\"path\":\"/\"},\"flash\":{}}", "expires" : ISODate("2013-12-24T09:24:27.846Z") }
{ "_id" : "MEkFGzd190YeJAGDH3nzLT14", "session" : "{\"cookie\":{\"originalMaxAge\":null,\"expires\":null,\"httpOnly\":true,\"path\":\"/\"},\"flash\":{}}", "expires" : ISODate("2013-12-24T09:44:10.585Z") }
>
My understanding is they should store value of connect.id both on client cookie and somewhere on server db or memory. Since I am using connect-mongo, the connect.id should store in db.sessions.
But I can't find the connect.id on server side. Where do they store this value? If my understand is wrong, please correct it. Thank you!