title: Where does express.session store hashed session key on server side?
body: <p>I am using mongoStore to manage session on express.js framework. </p>
  
  <pre><code>...
  var MongoStore = require('connect-mongo')(express);
  ...
  ...
  app.use(express.session({
      secret:settings.cookieSecret,
      store: new MongoStore({db:settings.db})
  }));
  ...
  </code></pre>
  
  <p><img src="https://i.stack.imgur.com/QIcH4.png" alt="this is the connect.sid and its value"></p>
  
  <p>but here is the record in sessions collection on mongoDB</p>
  
  <pre><code>&gt; 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") }
  &gt; 
  </code></pre>
  
  <p>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. </p>
  
  <p>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!</p>