public static void logout(HttpServletRequest request, HttpServletResponse response,
            FallbackPredicate useFallback, String fallbackPath) {
        if (!Boolean.TRUE.toString().equals(request.getHeader(FORM_IS_RESUBMITTED))) {
            SecurityUtils.getSubject().logout();
            FormResubmitSupport.redirectToView(request, response, useFallback, fallbackPath);
        }
    }
makes sure that there is no double-logout

@param request
@param response
@param useFallback
@param fallbackPath
support/jakarta-ee/src/main/java/org/apache/shiro/ee/filters/Forms.java