protected String fetchSessionIdFromContext(final WebContext webContext) {
        LOGGER.trace("Fetched session id from context");
        var sessionId = (String) webContext.getRequestAttribute(SESSION_ID_IN_REQUEST_ATTRIBUTE).orElse(null);
        if (StringUtils.isBlank(sessionId)) {
            LOGGER.trace("Session id not found as a request attribute; checking session cookie [{}]", cookieGenerator.getCookieName());
            val context = (JEEContext) webContext;
            sessionId = cookieGenerator.retrieveCookieValue(context.getNativeRequest());
        }
        LOGGER.trace("Fetched session id: [{}]", sessionId);
        return sessionId;
    }
This is {@link TicketRegistrySessionStore}.

@author Misagh Moayyed
@author Jerome LELEU
@since 6.1.0
support/cas-server-support-pac4j-api/src/main/java/org/apereo/cas/pac4j/TicketRegistrySessionStore.java