title: nodejs: where session stores? what is connect-mongo?
body: <p>i m creating application, using nodejs (0.8.15), express (>3.0) framework, socket.io and mongodb for register users.</p>
  
  <p>1) Everyone knows that it is easy to create simple chat using only socket.io, without mongodb (or other). So, in this case where stores the messages? in session?</p>
  
  <p>2) this second question is <strong>VERY IMPORTANT</strong> for me</p>
  
  <p>i don't understand: why are MongoStore there for sessions? i read that it is "SessionStorage for connect's session middleware/Connect". As i know session destroys when user go away from site. So why do people store it and use  <code>require('connect-mongo')</code> ??</p>
  
  <pre><code>var config = require('../config'),
      express = require('express'),
      MongoStore = require('connect-mongo'),
      server = express.createServer();
  
  server.configure(function() {
      server.use(express.logger());
      server.use(express.methodOverride());
      server.use(express.static(config.staticPath));
      server.use(express.bodyParser());
      server.use(express.cookieParser());
      server.use(express.session({
          store: new MongoStore({
              db: config.db
          }),
          secret: config.salt
      }));
  });
  </code></pre>
  
  <p>code i have just found. it seems it is for express 2.x</p>
  
  <p>3) what is the difference between <code>connect-mongo</code> and <code>connect-mongodb</code> libs?
  <a href="https://github.com/masylum/connect-mongodb" rel="nofollow">https://github.com/masylum/connect-mongodb</a></p>
  
  <p><a href="https://github.com/kcbanner/connect-mongo" rel="nofollow">https://github.com/kcbanner/connect-mongo</a></p>
  
  <p>4) do i have to make MongoStore for cookies and sockets?</p>
  
  <p>thank you!</p>