code: func (s *session) Set(sessionType apitypes.SessionType, identity, auth envelope.Envelope,
  	passphrase []byte, token []byte) error {
  	s.mutex.Lock()
  	defer s.mutex.Unlock()
  
  	err := checkSessionType(sessionType, identity, auth)
  	if err != nil {
  		return err
  	}
  
  	if len(passphrase) == 0 {
  		return errors.New("Passphrase must not be empty")
  	}
  
  	if len(token) == 0 && sessionType == apitypes.UserSession {
  		return errors.New("Token must not be empty")
  	}
  
  	s.sessionType = sessionType
  	s.passphrase, err = s.guard.Secret(passphrase)
  	if err != nil {
  		return err
  	}
  
  	s.token, err = s.guard.Secret(token)
  	if err != nil {
  		return err
  	}
  
  	s.identity = identity
  	s.auth = auth
  
  	return nil
  }
docs: // Set atomically sets all relevant session details.
  //
  // It returns an error if any values are empty.