code: func (s *Server) invalidateSession(id string) {
  	defer metrics.MeasureSince([]string{"session_ttl", "invalidate"}, time.Now())
  
  	// Clear the session timer
  	s.sessionTimers.Del(id)
  
  	// Create a session destroy request
  	args := structs.SessionRequest{
  		Datacenter: s.config.Datacenter,
  		Op:         structs.SessionDestroy,
  		Session: structs.Session{
  			ID: id,
  		},
  	}
  
  	// Retry with exponential backoff to invalidate the session
  	for attempt := uint(0); attempt < maxInvalidateAttempts; attempt++ {
  		_, err := s.raftApply(structs.SessionRequestType, args)
  		if err == nil {
  			s.logger.Printf("[DEBUG] consul.state: Session %s TTL expired", id)
  			return
  		}
  
  		s.logger.Printf("[ERR] consul.session: Invalidation failed: %v", err)
  		time.Sleep((1 << attempt) * invalidateRetryBase)
  	}
  	s.logger.Printf("[ERR] consul.session: maximum revoke attempts reached for session: %s", id)
  }
docs: // invalidateSession is invoked when a session TTL is reached and we
  // need to invalidate the session.