Avatar

Employee

From your code, you are never logging out.

public function registerSession($session : ConnectSession) : void {
     if (_session != null) {
          _session.removeEventListener(SessionEvent.SYNCHRONIZATION_CHANGE, onLogin);
          _session.logout();
          _session.close();
     }

     _session = $session;

     if (_session != null) {
          _session.addEventListener(SessionEvent.SYNCHRONIZATION_CHANGE, onLogin);
          _session.login();
     }
}


From a cursory glance, the could should be modifed to

public function registerSession($session : ConnectSession) : void {
     if (_session == null) {
          _session.removeEventListener(SessionEvent.SYNCHRONIZATION_CHANGE, onLogin);
          _session.logout();
          _session.close();
     }

     _session = $session;

     if (_session != null) {
          _session.addEventListener(SessionEvent.SYNCHRONIZATION_CHANGE, onLogin);
          _session.login();
     }
}