public static Optional<String> getBrowserStoragePayload(final HttpServletRequest httpServletRequest) {
        val parameters = getHttpRequestParametersFromRequestBody(httpServletRequest);
        FunctionUtils.doIfNotBlank(httpServletRequest.getParameter(BrowserStorage.PARAMETER_BROWSER_STORAGE),
            value -> parameters.put(BrowserStorage.PARAMETER_BROWSER_STORAGE, value));
        return parameters
            .entrySet()
            .stream()
            .filter(param -> param.getKey().equalsIgnoreCase(BrowserStorage.PARAMETER_BROWSER_STORAGE))
            .map(Map.Entry::getValue)
            .filter(StringUtils::isNotBlank)
            .findFirst()
            .or(() -> Optional.ofNullable((String) httpServletRequest.getAttribute(BrowserStorage.PARAMETER_BROWSER_STORAGE)));
    }
Gets browser storage.

@param httpServletRequest the http servlet request
@return the browser storage
core/cas-server-core-web-api/src/main/java/org/apereo/cas/web/support/WebUtils.java