code: func (s *SessionRegistry) emitSessionLeaveEvent(party *party) {
  	sessionLeaveEvent := events.EventFields{
  		events.EventType:       events.SessionLeaveEvent,
  		events.SessionEventID:  party.id.String(),
  		events.EventUser:       party.user,
  		events.SessionServerID: party.serverID,
  		events.EventNamespace:  s.srv.GetNamespace(),
  	}
  
  	// Emit session leave event to Audit Log.
  	party.s.recorder.GetAuditLog().EmitAuditEvent(events.SessionLeave, sessionLeaveEvent)
  
  	// Notify all members of the party that a new member has left over the
  	// "x-teleport-event" channel.
  	for _, p := range s.getParties(party.s) {
  		eventPayload, err := json.Marshal(sessionLeaveEvent)
  		if err != nil {
  			s.log.Warnf("Unable to marshal %v for %v: %v.", events.SessionJoinEvent, p.sconn.RemoteAddr(), err)
  			continue
  		}
  		_, _, err = p.sconn.SendRequest(teleport.SessionEvent, false, eventPayload)
  		if err != nil {
  			s.log.Warnf("Unable to send %v to %v: %v.", events.SessionJoinEvent, p.sconn.RemoteAddr(), err)
  			continue
  		}
  		s.log.Debugf("Sent %v to %v.", events.SessionJoinEvent, p.sconn.RemoteAddr())
  	}
  }
docs: // emitSessionLeaveEvent emits a session leave event to both the Audit Log as
  // well as sending a "x-teleport-event" global request on the SSH connection.