protected void destroy(final WebContext webContext, final SessionStore sessionStore,
                           final ProfileManagerFactory profileManagerFactory, final String channel) {
        // remove profiles
        val manager = profileManagerFactory.apply(webContext, sessionStore);
        manager.removeProfiles();
        LOGGER.debug("{} channel logout call: destroy the user profiles", channel);
        // and optionally the web session
        if (destroySession) {
            LOGGER.debug("destroy the whole session");
            val invalidated = sessionStore.destroySession(webContext);
            if (!invalidated) {
                LOGGER.error("The session has not been invalidated");
            }
        }
    }
<p>destroy.</p>

@param webContext a {@link WebContext} object
@param sessionStore a {@link SessionStore} object
@param profileManagerFactory a {@link ProfileManagerFactory} object
@param channel a {@link String} object
pac4j-core/src/main/java/org/pac4j/core/logout/handler/DefaultSessionLogoutHandler.java