Dear,

I use the HttpClient to login some page, and it will have a cookie according to 
my login.

But when I try to access another page (needed for logon) by the same 
HttpClient, the response is access denied. 

Then I print out the cookies of the two connection, I found them are different.

But the document said I don't need to care the cookie issue when I use 
HttpClient to login and continue browsing other pages.

Here is some sample pseudo code to demo.

---------
DefaultHttpClient httpclient = new DefaultHttpClient();

HttpPost httpPost = new HttpPost("http://127.0.0.1/login.html";);

// response 200, and login ok!
HttpResponse response = httpclient.execute(httpPost);

HttpEntity entity = response.getEntity(); // cookie with a session id "1" for 
example

// continue to another page
httpPost = new HttpPost("http://127.0.0.1/info.html";);

// response 200, and access denied
HttpResponse response2 = httpclient.execute(httpPost);

HttpEntity entity2 = response2.getEntity(); // cookie with a session id "2" for 
example

// the session is different
---------

I think the session id in the cookie should be the same, so that I can browse 
all pages after the first logon action.

But the truth is not?! How it can be that??

Thanks for any reply or suggestion.

Sincerely,
Micky




---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to