hc-httpclient-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Thom Hehl <t...@nowhereatall.com>
Subject Problems with cookies:RESOLVED!!!!
Date Thu, 08 Sep 2005 15:01:44 GMT

Thanks to Roland Weber. This is a recap of the problem for the archive.

Using HttpClient 3.0rc3, I was having discrepancies between a live 
session using cookies and the same session ran by httpclient. After 
weeks of attempts I finally used TCPDUMP to compare the results of the 
two different sessions. What I found was that the browser session was 
sending cookies as:

Cookie: id=bmedia; pw=solutions; listing_search=; listing_keyword=;

and httpClient was sending them as:

Cookie: $Version=0; id=bmedia
Cookie: $Version=0; pw=solutions
Cookie: $Version=0; listing_search=
Cookie: $Version=0; listing_keyword=
Cookie: $Version=0; listing_pagenum=1

Now, according to Roland, this complies to spec, but not all cgi 
programs are smart enough to handle it.

To fix my problem, I added the following line of code to my program:

HttpClientParams parms=Client.getParams().setBooleanParameter(
HttpMethodParams.SINGLE_COOKIE_HEADER, true);

Everything now works perfectly.

Thanks to Mike and everyone else who helped!

"In every revolution, there is one man with a vision."--Jerome Bixby

Thom Hehl
<A href="www.heavyweightsoftware.com"> www.heavyweightsoftware.com</A>

To unsubscribe, e-mail: httpclient-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: httpclient-user-help@jakarta.apache.org

View raw message