@Override
    public void afterSessionTermination(final List<? extends Serializable> terminationResults, final RequestContext requestContext) {
        val request = WebUtils.getHttpServletRequestFromExternalWebflowContext(requestContext);
        terminationResults
            .stream()
            .filter(Pac4jRequestedUrl.class::isInstance)
            .map(Pac4jRequestedUrl.class::cast)
            .filter(req -> StringUtils.isNotBlank(req.url()))
            .forEach(req -> request.getSession(true).setAttribute(Pac4jConstants.REQUESTED_URL, req.url()));
    }
This is {@link DelegatedProfileTerminationHandler}.

@author Misagh Moayyed
@since 7.0.0
support/cas-server-support-pac4j-core/src/main/java/org/apereo/cas/web/flow/logout/DelegatedProfileTerminationHandler.java