It is simple to get access to session
property from the action of controller.
var SomeController = {
someAction: function(req, res) {
// no we have access to session object
if (!req.session.hasOwnProperty('flash')) {
req.session.flash = [];
}
}
}
But I need to get access to session
object from service.
Example file app/services/my_servise.js
:
module.exports = {
some_method: function() {
// here at i need to get access to session object?
// is it possible?
}
}