node.js - Modify Express sessions on set and get -


i'm wondering if there's way (globally via express middleware) intercept , set of session objects.

so, instance if somewhere in 1 of controllers set req.session.foo = 'bar' can change bar baz, when req.session.foo accessed can send bar.

i'm not sure trying accomplish should take @ connect-flash middleware store messages in requests.

from docs:

app.get('/flash', function(req, res){   // set flash message passing key, followed value, req.flash().   req.flash('info', 'flash back!')   res.redirect('/'); });  app.get('/', function(req, res){   // array of flash messages passing key req.flash()   res.render('index', { messages: req.flash('info') }); }); 

Comments

Popular posts from this blog

database - VFP Grid + SQL server 2008 - grid not showing correctly -

jquery - Set jPicker field to empty value -

.htaccess - htaccess convert request to clean url and add slash at the end of the url -