Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [jetty-users] Using a NULL cookieStore to suppress unparseable cookie logging

Yes, I should I have mentioned that I did try that one. The CookieManager in Oracle JDK 1.8.0_20 still appears to parse them and output those messages in the LOG (see below).

This isn’t really a Jetty issue. It’s more just a sontraint of Jetty that I can’t set a NULL cookieStore to workaround it.

           for (String headerValue : responseHeaders.get(headerKey)) {
                try {
                    List<HttpCookie> cookies;
                    try {
                        cookies = HttpCookie.parse(headerValue);
                    } catch (IllegalArgumentException e) {
                        // Bogus header, make an empty list and log the error
                        cookies = java.util.Collections.emptyList();
                        if (logger.isLoggable(PlatformLogger.Level.SEVERE)) {
                            logger.severe("Invalid cookie for " + uri + ": " + headerValue);

Bradley Wagner
VP Engineering - Hannon Hill
+1 (678) 904-6900 x115

The 10th annual Cascade User Conference is Sept 20-22! #CUC15

On Tue, Apr 28, 2015 at 3:31 PM, Simone Bordet <sbordet@xxxxxxxxxxx> wrote:


On Tue, Apr 28, 2015 at 8:33 PM, Bradley Wagner
<bradley.wagner@xxxxxxxxxxxxxx> wrote:
> Hi, we’ve built a link checker using Jetty’s HttpClient and we’re trying to suppress SEVERE error logging that we’re seeing as a result of unparseable cookies (see below). Basically, we’re not interested in cookies at all. I saw in Java’s CookieManager that we could bypass this code if the cookieStore was NULL but I don’t see any way to set a NULL cookieStore on Jetty’s HttpClient since it validates it non-null on set.
> Any clever workarounds or suggestions on how we could use a NULL cookieStore or otherwise suppress this error? Thanks!

httpClient.setCookieStore(new HttpCookieStore.Empty());

sets a no-operation cookie store that does not parse nor store them.

That good ?

Simone Bordet
Developer advice, training, services and support
from the Jetty & CometD experts.
Intalio, the modern way to build business applications.
jetty-users mailing list
To change your delivery options, retrieve your password, or unsubscribe from this list, visit

Back to the top