commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Philipp Leusmann" <>
Subject [httpclient] Problems receiving cookies
Date Tue, 04 Mar 2003 13:25:54 GMT

I am in trouble receiving cookies with httpclient. Exactly, only one cookie
of two is received.
The packet I get back from the webserver sniffed with ethereal looks like
HTTP/1.1 200 OK
Date: Tue, 04 Mar 2003 13:18:27 GMT
Server: Apache/1.3.26 (Unix) Debian GNU/Linux PHP/4.1.2 mod_jk/1.1.0
Set-Cookie: IPS_PAY_PAGE_URL=/paypage/
Set-Cookie: JSESSIONID=904F15BE85221EECB578B990C3606B52;Path=/paypage
Transfer-Encoding: chunked
Content-Type: text/plain; charset=iso-8859-1
But only the IPS_PAY_PAGE_URL-cookie is received.

my code looks like this:
URL url = new URL("");
// Prepare HTTP post
PostMethod post = new PostMethod(url.toString());
// Get initial state object
NameValuePair form_data[] = new NameValuePair[12];
   [...] some form data [...]
// Get HTTP client
HttpClient httpclient = new HttpClient();
// Execute request
int result = httpclient.executeMethod(post);
// Get all the cookies
Cookie[] cookies = httpclient.getState().getCookies();
I also tried setting the CookiePolicy, but no matter what I put in, the
result stays the same.

I am using HttpClient 2.0alpha1

Hope someone can help,

View raw message