Hi,
I want to do the following:
1. The main thread/conneciton logins to a web site. It is a post request like a online banking login, not HTTP authentication. The server will return a cookie containing session id.
2. Then the main thread creates two simultaneous threads to create two connections to send two queries to the web site. Of course the cookie needs to be sent with the get request.


My questions are:
1. Can the two subsequent threads/connections use the HttpState from the main thread/connection directly? Or, should I clone two HttpState for the two sub-threads? Does the clone() method of HttpState work properly?


2. Do HttpState.addCookies() and HttpState.getCookies() create COPIES of the cookies or work on the cookie objects directly?

3. This question is somewhat related to the above one.
client.executeMethod(method1);
Cookies[] cookie1=state.getState().getCooies();
client.executeMethod(method2);
Cookies[] cookie2=state.getState().getCooies();
If the server changes some cookies in the second method, will the cookie objects in cookie1[] be changed?


Thanks.

Yue


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



Reply via email to