Reputation: 21587
when i set a session in express.js route like
app.get('/', function(req, res() {
req.session.foo = 'bar';
});
i can't access it (undefined) in other routes. is this possible? is there a special configuration i have to consider?
thanks!
Upvotes: 4
Views: 1829
Reputation: 21587
i actually solved it by just setting the sessions like this:
global.session.email = JSON.parse(chunk).email;
through this, the session variables are global!
solved!
Upvotes: 1