exports.post = function (req, res, next) {
var sid = req.session.id;
var io = req.app.get('io');
req.session.destroy(function (err) {
io.sockets.$emit('session:reload', sid);
// ...
res.redirect('/');
}
};
io.sockets.on('session:reload', function(sid) {
// ...
});
io.on("sessreload",function(sid){
//some code
});
exports.post = function(req, res,next){
var sid = req.session.id;
var io = req.app.get("io");
req.session.destroy(function(err){
io.sockets._events.sessreload(sid);
if(err) next(err);
res.redirect('/');
});
};