I am trying to use the built-in cookieSession object to connect, but I cannot get it to work correctly with an expression.
I have this application:
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 get this error:
TypeError: Cannot read property 'connect.sess' of undefined at Object.cookieSession [as handle]
Any ideas?
thanks
mihai
source share