title: Share sessions with redis and passport on a subdomain?
body: <p>I am using npm subdomain, inside my app I have routes that fake a subdomain</p>
  
  <pre><code>// looks like app.localhost:3000
  router.get('/subdomain/app', app.dashboard);
  </code></pre>
  
  <p>So I have a login page on a subdomain and a login page on a non subdomain page. They don't share sessions, so I have to login twice. I want to setup redis, but I don't know how.</p>
  
  <pre><code>// here is my session middleware, I tried using .localhost
  app.use(session({ secret: 'something', domain: '.localhost', }));
  </code></pre>
  
  <p>I have seen where people are using redis like </p>
  
  <pre><code>app.use(express.session({
      store:new RedisStore({
          host: config.redis.session.host,
          port: config.redis.session.port,
          db: config.redis.session.db
      }),
      secret: config.session_secret
  }));
  </code></pre>
  
  <p>This seems like it could solve my issue but I have no clue how to setup a redisStore and where the config data comes from?</p>
  
  <p>Can someone explain to me how to use redis so that when a user logs in on either app.example.io or example.io that he/she is logged in for good, no need to log in twice?</p>