title: How configure Redis Store for my production env?
body: <p>I am trying to setup Redis for a session store, but is not working at. I'm using <code>passport.js</code> and <code>express-flash</code>, and if I try run the current Redis setup, it won't work:</p>
  
  <pre><code>var session = require('express-session');
  var favicon = require('serve-favicon');
  var cookieParser = require('cookie-parser');
  var bodyParser = require('body-parser');
  
  var redis = require("redis").createClient();
  var RedisStore = require("connect-redis")(session);
  
  var load = require('express-load');
  var flash = require('express-flash');
  var path = require('path');
  var logger = require('morgan');
  var i18n = require('i18n-2');
  var passport = require('passport');
  var mongoose = require('mongoose');
  </code></pre>
  
  <p>If I use this session setup:</p>
  
  <pre><code>app.use(session({
    secret: 'keyboard cat'
  }));
  </code></pre>
  
  <p>This will show an error saying that is not safe for use in production, however the <code>passport.js</code> and the express-flash will work.</p>
  
  <p>Moving on to Redis:</p>
  
  <pre><code>app.use(session({
    store: new RedisStore({
       host: 54.94.171.197, 
       port: 3000,
       client: redis
     }),
    secret: 'keyboard cat'
  }));
  </code></pre>
  
  <p>Should I put the static IP in the host and the 3000 in the port? I am very confused with the proper values that I need pass to the new instance.</p>
  
  <p>This is my middleware:</p>
  
  <pre><code>app.use(favicon(__dirname + '/public/images/icons/fav.ico'));
  app.use(logger('dev'));
  app.use(bodyParser.json());
  app.use(bodyParser.urlencoded({
    extended: false
  }));
  app.use(flash());
  app.use(cookieParser());
  app.use(express.static(path.join(__dirname, 'public')));
  app.use(session({
    store: new RedisStore({
      host: global.config.site.host,
      port: 6379,
      client: redis
    }),
    secret: 'keyboard cat'
  }));
  
  // Productions Middlewares
  
  if (process.env.NODE_ENV === 'production') {
    app.use(passport.initialize());
    app.use(passport.session());
    app.use('/admin', middleware.ensureAuthenticated);
    app.use(middleware.ensureHttps);
  }
  </code></pre>