I'm trying to use the built in cookieSession
object of connect, but I cannot get it to work properly with express.
I have this app:
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);
I'm getting this error:
TypeError: Cannot read property 'connect.sess' of undefined
at Object.cookieSession [as handle]
Any ideas?