@Override
    public String readValue(HttpServletRequest request, HttpServletResponse ignored) {
        String name = getName();
        String value = null;
        javax.servlet.http.Cookie cookie = getCookie(request, name);
        if (cookie != null) {
            // Validate that the cookie is used at the correct place.
            String path = StringUtils.clean(getPath());
            if (path != null && !pathMatches(path, request.getRequestURI())) {
                LOGGER.warn("Found '{}' cookie at path '{}', but should be only used for '{}'",
                        name, Encode.forHtml(request.getRequestURI()), path);
            } else {
                value = cookie.getValue();
                LOGGER.debug("Found '{}' cookie value [{}]", name, Encode.forHtml(value));
            }
        } else {
            LOGGER.trace("No '{}' cookie value", name);
        }

        return value;
    }
Formats a date into a cookie date compatible string (Netscape's specification).

@param date the date to format
@return an HTTP 1.0/1.1 Cookie compatible date string (GMT-based).
web/src/main/java/org/apache/shiro/web/servlet/SimpleCookie.java