title: How to properly setup redis for session store
body: <p>I am trying to setup Redis Store like this:</p>
  
  <pre><code>var express = require('express');
  var app = express();
  .......
  .......
  var session = require('express-session');
  var redis = require("redis").createClient();
  var RedisStore = require("connect-redis")(session);
  
  app.use(session({
    store: new RedisStore({
       host: 'localhost',
       port: 6379,
       client: redis
     }),
    secret: 'keyboard cat'
  }));
  </code></pre>
  
  <p>But using like this the passport.js wont work and the <code>express-flash</code> will throw an error: `Error: req.flash() requires sessions.</p>
  
  <p>I believe Redis is not working at all.</p>
  
  <p>I am very confuse with the configuration also, should i put localhost in the host key? I am using Cloud 9, not my localhost.</p>
  
  <p>What i am doing wrong?</p>