code: func CreateSession(store kv.Storage) (Session, error) {
  	s, err := createSession(store)
  	if err != nil {
  		return nil, err
  	}
  
  	// Add auth here.
  	do, err := domap.Get(store)
  	if err != nil {
  		return nil, err
  	}
  	pm := &privileges.UserPrivileges{
  		Handle: do.PrivilegeHandle(),
  	}
  	privilege.BindPrivilegeManager(s, pm)
  
  	sessionBindHandle := bindinfo.NewSessionBindHandle(s.parser)
  	s.SetValue(bindinfo.SessionBindInfoKeyType, sessionBindHandle)
  	// Add stats collector, and it will be freed by background stats worker
  	// which periodically updates stats using the collected data.
  	if do.StatsHandle() != nil && do.StatsUpdating() {
  		s.statsCollector = do.StatsHandle().NewSessionStatsCollector()
  	}
  
  	return s, nil
  }
docs: // CreateSession creates a new session environment.