views:

250

answers:

1

In Java HttpClient feature list it says:

Automatic Cookie handling for reading Set-Cookie: headers from the server and sending them back out in a Cookie: header when appropriate.

But I can't figure out how to use this feature. I just need to open a web page, let it set all the cookies, then refresh the same page with received cookies.

Thanks.

+4  A: 

I kept getting errors back from the server saying my client didn't support cookies and I should turn them on. The following line stopped those errors. Hope this works for you.

httpClient.setCookieStore(new BasicCookieStore());
dharga