Let's say I have this:
a) 2 routes with 1 middleware function each and a callback function:
router.post('/foo', fooCtrl, function(req, res)
router.get('/bar', barCtrl, function(req, res)
fooCtrl = function(req, res, next)
req.foo = 'foo';
barCtrl = function(req, res, next)
console.log(req.foo); // output is 'undefined'
That is the expected behaviour.
req object is created anew for each new request and your redirection i.e.
res.redirect('/bar') results in a new request.
You may use some package e.g.
connect-flash which stores variables in a temporary session object, which can be used only once. You need to set required values in your flash objects before redirecting. Then after redirection, you will be able to get the saved values from the flash object itself.