hc-httpclient-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Oleg Kalnichevski <ol...@apache.org>
Subject Re: How do you set cookies on initial post in HttpClient?
Date Sun, 22 Feb 2009 16:07:00 GMT
Scott Mueller wrote:
> I tried to add cookies like this, but no cookies are set as can be seen by
> the actual http post:
> DefaultHttpClient client = new DefaultHttpClient();
> client.getCookieStore().addCookie(new BasicClientCookie("JSESSIONID",
> getParameter("session")));

You also need to correctly set the domain and path attributes of the 
cookie. If the domain attribute of a cookie is set incorrectly, 
HttpClient will be unable to match it to the origin server.


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

View raw message