title: ExpressJS creates a new session on each page change
body: <p>I'm trying to implement express and passport sessions like so:</p>
  
  <pre><code>  app.use(connect.bodyParser());
    app.use(express.cookieParser());
    app.use(express.session({
      cookie: {
        path: "/",
        httpOnly: true,
        maxAge: null
      },
      store: redisStoreConnect,
      secret: "something",
      key: 'pksy.sid'
    }));
    app.use(passport.initialize());
    app.use(passport.session());
  
    passport.serializeUser (user, done) -&gt;
      done null, user.email
      return
  
    passport.deserializeUser (email, done) -&gt;
      User.findOne
          email: email
        , (err, user) -&gt;
          done err, user
          return 
      return
  </code></pre>
  
  <p>If I navigate to a page in my site, a new session is created and stored in redis. If I refresh that page, the session appears to persist. If I navigate to a new page or even if I close the tab and reopen to the same page, a new session is created. </p>
  
  <p>This is especially frustrating since passport only authenticates the session that was generated for my login page. How do I get my sessions to persist across pages?</p>
  
  <p><strong>Update:</strong> Thanks @robertklep for reminding me to check what cookie the browser was actually sent back (which I should have done to start). It turns out the browser is sending back the right cookie, and the authentication is working. The sessions are in fact persisting, but for some reason a new session (unused by the browser) get's created with each page request. How can I stop this?</p>