Possible HttpURLConnection.setFollowRedirects bug?I

W

Wil Hadden

Hi,

I have discovered a slightly obscure scenario that may cause a bug in
HttpURLConnection and I was wondering if anyone could confirm it.

With automatic redirection turned on, if I do a HTTP GET request, with
various cookies set and I recieve a 302 redirect, HttpURLConnection
will do the redirection but will not send on the cookies at the same
time.

I have confirmed that all browsers will send on the cookies. The net
result is that the server will usually process the redirect
differently due to the lack of cookies being sent to the new page.

I am using the lastest 1.4 JRE.

I may not be able to reply to this until Monday.

Wil
 
B

Brusque

Wil Hadden said:
Hi,

I have discovered a slightly obscure scenario that may cause a bug in
HttpURLConnection and I was wondering if anyone could confirm it.

With automatic redirection turned on, if I do a HTTP GET request, with
various cookies set and I recieve a 302 redirect, HttpURLConnection
will do the redirection but will not send on the cookies at the same
time.

I have confirmed that all browsers will send on the cookies. The net
result is that the server will usually process the redirect
differently due to the lack of cookies being sent to the new page.

I am using the lastest 1.4 JRE.

I may not be able to reply to this until Monday.

Wil

HttpURLConnection doesn't do automatic cookie handling. It's only a very
basic HTTP Client.

Try using Commons HttpClient http://jakarta.apache.org/commons/httpclient/
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,755
Messages
2,569,537
Members
45,022
Latest member
MaybelleMa

Latest Threads

Top