It doesn\'t seem that HttpServletResponse exposes any methods to do this.
Right now, I\'m adding a bunch of logging code to a crufty and ill-understood servlet, in
Cookies are sent to the client in the "Set-Cookie" response header. Try this:
private static void logResponseHeaders(HttpServletResponse httpServletResponse) {
Collection headerNames = httpServletResponse.getHeaderNames();
for (String headerName : headerNames) {
if (headerName.equals("Set-Cookie")) {
log.info("Response header name={}, header value={}", headerName, httpServletResponse.getHeader(headerName));
}
}
}