You are viewing a plain text version of this content. The canonical link for it is here.
Posted to httpclient-users@hc.apache.org by Thom Hehl <th...@nowhereatall.com> on 2005/09/08 17:01:44 UTC

Problems with cookies:RESOLVED!!!!

Yeah!

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