title: Redis error: Error: Redis connection to 127.0.0.1:6379 failed - connect ECONNREFUSED 127.0.0.1:6379
body: <p>When I checked my redis-server status , it says redis server is running but I got this error when I log
  RedisClient.on('error', function(err) {
  console.log('Redis error: ' + err);// Redis error: Error: Redis connection to 127.0.0.1:6379 failed - connect ECONNREFUSED 127.0.0.1:6379
  });
  and when I try to console the req.session it returns undefined. any clue about this issue?
  please help me I am new to this. thank you</p>
  
  <p>heres my setup:</p>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>var express = require('express');
  var redis = require("redis");
  var session = require('express-session');
  var redisStore = require('connect-redis')(session);
  var parser = require('body-parser');
  var RedisClient= redis.createClient();
  
  app.use(session({
  secret: 'myseceret',
  store: new redisStore({host: '127.0.0.1', port: 6379, client: client,ttl : 260}),
  saveUninitialized: false,
  resave: false,
  cookie: { secure: true }
  }));
  client.on('error', function(err) {
  console.log('Redis error: ' + err);
  });</code></pre>
  </div>
  </div>
  </p>