hc-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ortwin Gl├╝ck <ortwin.glu...@nose.ch>
Subject Re: Client cookies
Date Mon, 19 Jan 2004 14:19:40 GMT
Chris Picton wrote:
> I thus need to (I think) set a cookie containing JSESSIONID, and the
> current session id, which I have.  I cannot, however, find any sample
> code of setting a cookie in the client request (though the docs say it
> can be done)

There is no magic involved:

HttpClient client = ...

client.getState().addCookie(new Cookie("mydomain.com", "JSESSIONID", id));

client.execute(themethod);

HTH

Odi

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


Mime
View raw message