Thanks,
To add, the code that use the client (called concurrently by many
threads):
HttpResponse response = client.execute(call);
HttpEntity entity = response.getEntity();
if (entity != null) {
String body = EntityUtils.toString(entity);
String mime = entity.getContentType().getValue();
// process response ...
}
If we use new client.execute(call, new BasicHttpContext()) instead,
^^^^^^^^^^^^^^^^^^^^
is that going to create a transient storage for cookies that will not be
used between calls?
E
-----Original Message-----
Francois-Xavier Bonnet
Sent: Thursday, March 14, 2013 9:55 PM
To: HttpComponents Project
Subject: Re: Exception parsing cookies
I guess the application you are calling is developed with Zend framework
and the framework is setting automatically this cookie. I don't know if
there is a way to remove it.
An HttpClient instance has a default CookieStore. If you don't set a
different HttpContext for each request with a CookieStore in it,
HttpClient
will use the same default CookieStore for all users. I think your
problem
comes from concurrent accesses to this CookieStore which is not thread
safe.
If you want to be stateless, I suggest that you set HttpClient to just
ignore all cookies, this should solve your problem:
httpclient.getParams().setParameter(ClientPNames.COOKIE_POLICY,
CookiePolicy.IGNORE_COOKIES);
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]