hc-httpclient-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Roland Weber <ossf...@dubioso.net>
Subject Re: Question About Cookies
Date Wed, 05 Mar 2008 19:53:44 GMT
Joan Balagueró wrote:
> Now I know how to send a cookie just related to one thread. But how to
> receive a cookie from my remote server?
> 
> I was using : Cookie[] auxCookies = objHttp.getState().getCookies();
> 
> Now I know this is incorrect. I suppose that I must get cookies from the
> Post method.

You don't. HttpClient automagically puts cookies into the HttpState
object that you use for executing the method. Don't do anything,
just let it happen. And make sure that the thread is using the
same HttpState objects for the followup requests. Do NOT create
HttpState objects for each request, just one for each thread or
session.

cheers,
   Roland


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


Mime
View raw message