protected Event createSingleSignOnCookie(final RequestContext requestContext, final String ticketGrantingTicketId) {
        val ticketGrantingTicket = ticketRegistry.getTicket(ticketGrantingTicketId);
        if (ticketGrantingTicket.isStateless()) {
            return result(CasWebflowConstants.TRANSITION_ID_WRITE_BROWSER_STORAGE,
                new LocalAttributeMap<>(TicketGrantingTicket.class.getName(), ticketGrantingTicketId));
        }
        val request = WebUtils.getHttpServletRequestFromExternalWebflowContext(requestContext);
        val response = WebUtils.getHttpServletResponseFromExternalWebflowContext(requestContext);
        val rememberMeAuthentication = CookieRetrievingCookieGenerator.isRememberMeAuthentication(requestContext);
        ticketGrantingCookieBuilder.addCookie(request, response, rememberMeAuthentication, ticketGrantingTicketId);

        val applicationContext = requestContext.getActiveFlow().getApplicationContext();
        val clientInfo = ClientInfoHolder.getClientInfo();
        applicationContext.publishEvent(new CasSingleSignOnSessionCreatedEvent(this, ticketGrantingTicket, clientInfo));
        return success();
    }
Action that handles the TicketGrantingTicket creation and destruction. If the
action is given a TicketGrantingTicket and one also already exists, the old
one is destroyed and replaced with the new one. This action always returns
"success".

@author Scott Battaglia
@since 3.0.0
support/cas-server-support-actions-core/src/main/java/org/apereo/cas/web/flow/login/SendTicketGrantingTicketAction.java