I had the same problem with session.user and just fixed it by understanding that the app.use function needs to be IN the configure part, not where it was before.
Before:
app.configure();
app.dynamicHelpers({
user: function(req, res) {
return req.session.user;
}
});
After:
app.configure(function(){
//...
app.use(function(req, res, next){
res.locals.user = req.session.user;
next();
});
//...
});
for Flash have a look at connect-flash
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…