Below is an email from August 7th, which I'm reviving due to this becoming a bigger issue over in Bixo-land.

I've continued to run into this issue with my crawls, but so far I'm not doing anything with cookies, so it hasn't been a priority to track down.

However another Bixo user also runs into it, and he noticed that by switching back to HttpClient 4.0-beta3, the warnings went away.

I believe he just opened HTTPCLIENT-896 as a clone of HTTPCLIENT-773, which seemed to be this exact same bug (fixed by Oleg around 17/May/08).

I'm wondering if the bug crept back into the code sometime between then and the final release.

Thanks,

-- Ken

= = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = ========================================================================

Hi all,

I'm seeing errors in my logs relating to parsing the expires date value in a cookie:

09/08/07 10:26:46 WARN protocol.ResponseProcessCookies:137 - Invalid cookie header: "Set-Cookie: IU=deleted; expires=Thu, 07 Aug 2008 17:26:45 GMT; path=/; domain=.yahoo.com". Unable to parse expires attribute: Thu, 07 Aug 2008 17:26:45 GMT

I looked through the HtttpClient source, and it seems like if I've set up my cookie policy properly, the above date would be parsed properly.

Here's now I'm setting up the cookie policy:

=================================================================
HttpParams params = new BasicHttpParams();
...
CookieSpecParamBean cookieParams = new CookieSpecParamBean(params);
cookieParams.setSingleHeader(true);
...
ClientConnectionManager cm = new ThreadSafeClientConnManager(params, schemeRegistry);
DefaultHttpClient httpClient = new DefaultHttpClient(cm, params);
...
params = httpClient.getParams();
HttpClientParams.setCookiePolicy(params, CookiePolicy.BEST_MATCH);
=================================================================

But the above code was assembled from a few different snippets online, IIRC. So maybe this isn't correct.

For example, in the "Choosing Cookie Policy" section of the tutorial docs, it uses the setParameter() API to set the policy:

httpclient.getParams().setParameter(ClientPNames.COOKIE_POLICY, CookiePolicy.RFC_2965);

I assume the two are equivalent, but any input would be appreciated.

Thanks,

-- Ken

--------------------------------------------
<http://ken-blog.krugler.org>
+1 530-265-2225




--------------------------
Ken Krugler
TransPac Software, Inc.
<http://www.transpac.com>
+1 530-210-6378


---------------------------------------------------------------------
To unsubscribe, e-mail: httpclient-users-unsubscr...@hc.apache.org
For additional commands, e-mail: httpclient-users-h...@hc.apache.org

Reply via email to