code: def disconnect(self):
          
          if self.r_session:
              self.session_logout()
  
          self.r_session = None
          self.clear()
docs: Ends a client authentication session, performs a logout and a clean up.