lib/socket.js
function updateSession(socket) {
        if (socket._sessionID) {
            let time = (new Date()).getTime();
            if (socket._lastActivity && time - socket._lastActivity > settings.ttl * 1000) {
                socket.emit('reauthenticate');
                socket.disconnect();
                return false;
            }
            socket._lastActivity = time;
            if (!socket._sessionTimer) {
                socket._sessionTimer = setTimeout(function () {
                    socket._sessionTimer = null;
                    that.settings.store.get(socket._sessionID, function (err, obj) {
                        if (obj) {
                            that.adapter.setSession(socket._sessionID, settings.ttl, obj);
                        } else {
                            socket.emit('reauthenticate');
                            socket.disconnect();
                        }
                    });
                }, 60000);
            }
        }
        return true;
    }
function updateSession(socket) {
        if (socket._sessionID) {
            let time = (new Date()).getTime();
            if (socket._lastActivity && time - socket._lastActivity > settings.ttl * 1000) {
                socket.emit('reauthenticate');
                socket.disconnect();
                return false;
            }
            socket._lastActivity = time;
            if (!socket._sessionTimer) {
                socket._sessionTimer = setTimeout(function () {
                    socket._sessionTimer = null;
                    that.settings.store.get(socket._sessionID, function (err, obj) {
                        if (obj) {
                            that.adapter.setSession(socket._sessionID, settings.ttl, obj);
                        } else {
                            socket.emit('reauthenticate');
                            socket.disconnect();
                        }
                    });
                }, 60000);
            }
        }
        return true;
    }
function updateSession ( socket ) { if ( socket . _sessionID ) { let time = ( new Date ( ) ) . getTime ( ) ; if ( socket . _lastActivity && time - socket . _lastActivity > settings . ttl * 1000 ) { socket . emit ( 'reauthenticate' ) ; socket . disconnect ( ) ; return false ; } socket . _lastActivity = time ; if ( ! socket . _sessionTimer ) { socket . _sessionTimer = setTimeout ( function ( ) { socket . _sessionTimer = null ; that . settings . store . get ( socket . _sessionID , function ( err , obj ) { if ( obj ) { that . adapter . setSession ( socket . _sessionID , settings . ttl , obj ) ; } else { socket . emit ( 'reauthenticate' ) ; socket . disconnect ( ) ; } } ) ; } , 60000 ) ; } } return true ; }
update session ID, but not ofter than 60 seconds
update session ID but not ofter than 60 seconds