code: @SneakyThrows
      public Event terminate(final RequestContext context) {
          val request = WebUtils.getHttpServletRequestFromExternalWebflowContext(context);
          val response = WebUtils.getHttpServletResponseFromExternalWebflowContext(context);
  
          val tgtId = getTicketGrantingTicket(context);
          if (StringUtils.isNotBlank(tgtId)) {
              LOGGER.trace("Destroying SSO session linked to ticket-granting ticket [{}]", tgtId);
              val logoutRequests = this.centralAuthenticationService.destroyTicketGrantingTicket(tgtId);
              WebUtils.putLogoutRequests(context, logoutRequests);
          }
          LOGGER.trace("Removing CAS cookies");
          this.ticketGrantingTicketCookieGenerator.removeCookie(response);
          this.warnCookieGenerator.removeCookie(response);
  
          destroyApplicationSession(request, response);
          LOGGER.debug("Terminated all CAS sessions successfully.");
  
          if (StringUtils.isNotBlank(logoutProperties.getRedirectUrl())) {
              WebUtils.putLogoutRedirectUrl(context, logoutProperties.getRedirectUrl());
              return this.eventFactorySupport.event(this, CasWebflowConstants.STATE_ID_REDIRECT);
          }
  
          return this.eventFactorySupport.success(this);
      }
docs: Terminates the CAS SSO session by destroying the TGT (if any) and removing cookies related to the SSO session.
  
  @param context Request context.
  @return "success"