hc-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Kalnichevski, Oleg" <oleg.kalnichev...@bearingpoint.com>
Subject RE: Cookie
Date Fri, 27 Jun 2003 07:30:59 GMT
> Does any one know how can I manage cookies without having to get the
> cookies from HttpState and setting it back everytime I make a request?

Just keep the HttpState instance.

> Is there an automatic way to handle cookies? Alternatively, how do I put
> a cookie header on PostMethod? I have string representation of the
> cookie, I would like to set that as a header on PostMethod. At present
> it does not allow me to do so.

Cookies are managed by HttpClient based on the content of HttpState. That is why setting 'Cookie'
header manually does not really help, as 'Cookie' headers automatically generated by HttpClient
always overwrite those set manually. Bottom line: always add your cookies to HttpState. Never
set them manually.

Oleg

Mime
View raw message