I have been trying to use the session middleware on Express framework.The exact line with the error is
if (fn.handle && fn.set) mount_app=fn;
Currently the app.js file contains
var express = require('express');
var session= require('express-session');
var app = express();
Accordingly I have used below
app.use(function(req,res,next){
res.locals.session = req.session;
next();
}
The reason given for errors of above type, in one of these forums was that the variable was being used before being defined. Could someone suggest how this could be done, or what is wrong with the above ordering.