title: express 4, inconsistent view count in sample code
body: <p><a href="https://github.com/expressjs/session" rel="nofollow">https://github.com/expressjs/session</a></p>
  
  <p>The following code is copied from req.session</p>
  
  <p>Using express 4, <strong>the problem is</strong></p>
  
  <p>The views count is working in firefox. Every time, the views increase once after a page refresh.</p>
  
  <p>The views count increases twice, in chrome and opera. That is not right?</p>
  
  <pre><code>var express = require('express');
  var session = require('express-session');
  var app = express();
  
  app.use(session({
    secret: 'keyboard cat',
    resave: true,
    saveUninitialized: true, 
    cookie: { maxAge: 60000 }
  }));
  
  app.use(function(req, res, next) {
    var sess = req.session;
    if (sess.views) {
      //test
      debugger;
  
      sess.views = sess.views + 1;
      res.setHeader('Content-Type', 'text/html');
      res.write('&lt;p&gt;views: ' + sess.views + '&lt;/p&gt;');
      res.write('&lt;p&gt;expires in: ' + (sess.cookie.maxAge / 1000) + 's&lt;/p&gt;');
      res.end();
    } else {
      sess.views = 1;
      res.end('welcome to the session demo. refresh!');
    }
  });
  
  app.listen(process.env.PORT || 4000);
  </code></pre>