pomelo icon indicating copy to clipboard operation
pomelo copied to clipboard

Session.data will be automaticlly sync to Other servers?

Open Lellansin opened this issue 11 years ago • 1 comments

If there is a data save in session, and I only use this session.data in the special type of server. At this situation, though it's not supposed, will the session.data to automaticlly sync to Other all type of servers?

Lellansin avatar Jun 01 '15 13:06 Lellansin

If you want to sync data session to another server so call method pushAll or push.

EG:

session.bind(player_id);
session.set('player_id', player_id);
/*sesssion close*/
session.on('closed', on_user_leave.bind(null, self.app));

/*push all session*/
session.pushAll();
/*or push*/
//session.push('player_id', function(err) {
//    if(err) {
//        console.error('set rid for session service failed! error is : %j', err.stack);
//    }
//});

letiennam29 avatar Jun 17 '15 11:06 letiennam29