code: func (s *server) CreateSession(sess Session) error {
  	if err := sess.ID.Check(); err != nil {
  		return trace.Wrap(err)
  	}
  	if sess.Namespace == "" {
  		return trace.BadParameter("session namespace can not be empty")
  	}
  	if sess.Login == "" {
  		return trace.BadParameter("session login can not be empty")
  	}
  	if sess.Created.IsZero() {
  		return trace.BadParameter("created can not be empty")
  	}
  	if sess.LastActive.IsZero() {
  		return trace.BadParameter("last_active can not be empty")
  	}
  	_, err := NewTerminalParamsFromInt(sess.TerminalParams.W, sess.TerminalParams.H)
  	if err != nil {
  		return trace.Wrap(err)
  	}
  	sess.Parties = nil
  	data, err := json.Marshal(sess)
  	if err != nil {
  		return trace.Wrap(err)
  	}
  	item := backend.Item{
  		Key:     activeKey(sess.Namespace, string(sess.ID)),
  		Value:   data,
  		Expires: s.clock.Now().UTC().Add(s.activeSessionTTL),
  	}
  	_, err = s.bk.Create(context.TODO(), item)
  	if err != nil {
  		return trace.Wrap(err)
  	}
  	return nil
  }
docs: // CreateSession creates a new session if it does not exist, if the session
  // exists the function will return AlreadyExists error
  // The session will be marked as active for TTL period of time