code: func (connection *VSphereConnection) Logout(ctx context.Context) {
  	clientLock.Lock()
  	c := connection.Client
  	clientLock.Unlock()
  	if c == nil {
  		return
  	}
  
  	m := session.NewManager(c)
  
  	hasActiveSession, err := m.SessionIsActive(ctx)
  	if err != nil {
  		klog.Errorf("Logout failed: %s", err)
  		return
  	}
  	if !hasActiveSession {
  		klog.Errorf("No active session, cannot logout")
  		return
  	}
  	if err := m.Logout(ctx); err != nil {
  		klog.Errorf("Logout failed: %s", err)
  	}
  }
docs: // Logout calls SessionManager.Logout for the given connection.