I have successfully managed cookies in threads. Your code shows setting the cookie policy, but not setting any actual cookies.
I would suggest creating a new HostConfiguration and HttpState for every executeMethod call, and use HttpClient.executeMethod(HostConfiguration, GetMethod, HttpState). The cookies are stored in and retrieved from HttpState. You will need to manage the storage of the cookies locally, including how to retrieve the proper cookies to be used in the current thread. --Steve -----Original Message----- From: Eugeny N Dzhurinsky [mailto:[EMAIL PROTECTED] Sent: Wednesday, July 05, 2006 11:52 AM To: [email protected] Subject: Re: managing cookies in threads After performing some tests, I found cookies are not set back to server at all for some reason. I wire logs i can see something like DEBUG 05/07/06 06:07:39 [Thread-3] (Wire:69) - << "Set-Cookie: ASPSESSIONIDQSCQASSS=IFLMCPNBLHAKEFLOMPPCOMCM; path=/[\r][\n]" And I assume this cookie is returned, but I can't see this cookie is sent to server. Code to retrieve page looks like: get = new GetMethod(); get.setURI(uri); get.setFollowRedirects(true); HttpMethodParams p = get.getParams(); p.setVersion(new HttpVersion(1, 1)); p.setCookiePolicy(CookiePolicy.BROWSER_COMPATIBILITY); http.executeMethod(get); Do I miss something? -- Eugene N Dzhurinsky --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
