You are viewing a plain text version of this content. The canonical link for it is here.
Posted to httpclient-users@hc.apache.org by Raphael Bauduin <rb...@gmail.com> on 2009/02/24 22:10:19 UTC
accepting cookies for another domain
Hi,
I'm using the delicious-java lib, which is itself using HttpClient.
I'm getting an error because the cookie set is for domain
delicious.com, but requests are sent to api.del.icio.us:
org.apache.commons.httpclient.HttpMethodBase processResponseHeaders
WARNING: Cookie rejected: "delicious_us_production=...... Illegal
domain attribute ".delicious.com". Domain of origin: "api.del.icio.us"
I have identified with object I should modify, but I don't know which
policy to use, so I triest all of them, without success (with the 3.0
release). I tried the 3.1 release with BROWSER_COMPATIBILITY policy,
which fails, and the 4.0 beta doeesn't work with the delicious lib.
Here's the line I'm changing (I'm sure this is the place to change the
code as when I ignore the cookies here, I don't get the error message)
httpClientParams.setCookiePolicy(org.apache.commons.httpclient.cookie.CookiePolicy.???);
Is it at all possible to accept cookies for another domain with httpclient?
Thanks in advance for your help
Raphaël
--
Web database: http://www.myowndb.com
Free Software Developers Meeting: http://www.fosdem.org
---------------------------------------------------------------------
To unsubscribe, e-mail: httpclient-users-unsubscribe@hc.apache.org
For additional commands, e-mail: httpclient-users-help@hc.apache.org
Re: accepting cookies for another domain
Posted by Oleg Kalnichevski <ol...@apache.org>.
Raphael Bauduin wrote:
> Hi,
>
> I'm using the delicious-java lib, which is itself using HttpClient.
>
> I'm getting an error because the cookie set is for domain
> delicious.com, but requests are sent to api.del.icio.us:
>
> org.apache.commons.httpclient.HttpMethodBase processResponseHeaders
> WARNING: Cookie rejected: "delicious_us_production=...... Illegal
> domain attribute ".delicious.com". Domain of origin: "api.del.icio.us"
>
> I have identified with object I should modify, but I don't know which
> policy to use, so I triest all of them, without success (with the 3.0
> release). I tried the 3.1 release with BROWSER_COMPATIBILITY policy,
> which fails, and the 4.0 beta doeesn't work with the delicious lib.
>
> Here's the line I'm changing (I'm sure this is the place to change the
> code as when I ignore the cookies here, I don't get the error message)
> httpClientParams.setCookiePolicy(org.apache.commons.httpclient.cookie.CookiePolicy.???);
>
> Is it at all possible to accept cookies for another domain with httpclient?
>
Yes, but you will have to implement a custom CookieSpec for that.
Oleg
> Thanks in advance for your help
>
> Raphaël
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: httpclient-users-unsubscribe@hc.apache.org
For additional commands, e-mail: httpclient-users-help@hc.apache.org