title: How to use cookieSession in express
body: <p>I'm trying to use the built in <code>cookieSession</code> object of connect, but I cannot get it to work properly with express.</p>
  
  <p>I have this app:</p>
  
  <pre><code>var express = require('express');
  var connect = require('connect');
  
  var app = express.createServer();
  
  app.configure(function() {
    app.use(express.logger());
    app.use(express.bodyParser());
    app.use(express.methodOverride());
    app.use(express.cookieParser('whatever'));
    app.use(connect.cookieSession({ cookie: { maxAge: 60 * 60 * 1000 }}));
  });
  
  app.get('/', function(req, res) {
      res.render('root');
  });
  
  app.listen(3000);
  </code></pre>
  
  <p>I'm getting this error:</p>
  
  <pre><code>TypeError: Cannot read property 'connect.sess' of undefined
      at Object.cookieSession [as handle] 
  </code></pre>
  
  <p>Any ideas?</p>
  
  <p>thanks</p>