hc-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ortwin Gl├╝ck <...@odi.ch>
Subject Re: [httpclient] Setting default CookiePolicy
Date Thu, 30 Aug 2007 07:45:34 GMT

HttpClient does not support "system wide" configuration through static
variables or system properties or similar. The main reason is that such
static configuration is unsuitable in complex systems where the same
library may be used by different applications or subsystems. Also the
boundary of "system wide" is not well-defined: while system properties
apply to the whole VM, static variables are local to the classloader.
And there are also problems when security managers are in place (e.g. in
Browser Applets). All in all it would lead to not well-defined
behaviour. The caller knows best how to configure HttpClient, so he is
fully responsible for it. Of course that makes it harder to fix problems
in code that is not under your control. All you can do is work together
with the author of that code.



keith chapman wrote:
> Hi,
> Is there a way so set a default cookie policy in HTTPClient. I tried
> CookiePolicy.setDefaultPolicy(CookiePolicy.COMPATIBILITY)  but it didn't
> work. (This is deprecated, also it does not work). What I need to is get rid
> of the following messages (I cannot change this property on a per request
> basis on the httpMethod itself). I know that
> httpmethod.getParams.setCookiePolicy works (I want to do it system wide by
> setting the property once)
> . Is there a workaround?  I had a look at
> http://jakarta.apache.org/commons/httpclient/cookies.html too.
> WARN [2007-08-02 08:19:38,513]  Cookie rejected: "$Version=0;
> cookie_l10n=en-us
> %3Bus; $Path=/; $Domain=flickr.com". Domain attribute " flickr.com" violates
> 2109: domain must start with a dot
>  WARN [2007-08-02 08:19:38,515]  Cookie rejected: "$Version=0;
> cookie_intl=delet
> ed; $Path=/; $Domain=flickr.com ". Domain attribute "flickr.com" violates
> RFC 210
> 9: domain must start with a dot
> Thanks,
> Keith

[web]  http://www.odi.ch/
[blog] http://www.odi.ch/weblog/
[pgp]  key 0x81CF3416
       finger print F2B1 B21F F056 D53E 5D79 A5AF 02BE 70F5 81CF 3416

To unsubscribe, e-mail: httpcomponents-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: httpcomponents-dev-help@jakarta.apache.org

View raw message