Perhaps its me, but HttpMethodBase is rejecting cookies that I think are 
correct. 

I create a new client and make a clean request (with no cookies) to 
http://somewhere/app/hdat/ . 

The response contains the following Set-Cookie headers 

Set-Cookie: TZS=abc;path=/app;
Set-Cookie: TZS=abc;path=/service;
Set-Cookie: TZS=abc;path=/linkto;
Set-Cookie: TZS=abc;path=/code;

I have also confirmed these headers by network trace. 

But I always get 

WARN  org.apache.commons.httpclient.HttpMethodBase - Cookie rejected: 
"$Version=0; TZS=abc; $Path=/service". Illegal path attribute "/service". Path 
of origin: "/app/hdat/"
WARN  org.apache.commons.httpclient.HttpMethodBase - Cookie rejected: 
"$Version=0; TZS=abc; $Path=/linkto". Illegal path attribute "/linkto". Path of 
origin: "/app/hdat/"
WARN  org.apache.commons.httpclient.HttpMethodBase - Cookie rejected: 
"$Version=0; TZS=abc; $Path=/code". Illegal path attribute "/code". Path of 
origin: "/app/hdat/"

Which confuses me, the cookies are simply being shared between seperate 
applications, there is no attempt to set for another domain. 

I have tried 

HttpClient 
client.getParams().setCookiePolicy(CookiePolicy.BROWSER_COMPATIBILITY);
HttpClient client.getParams().setCookiePolicy(CookiePolicy.DEFAULT);
HttpClient client.getParams().setCookiePolicy(CookiePolicy.NETSCAPE);
HttpClient client.getParams().setCookiePolicy(CookiePolicy.RFC_2109);

all of which result in he same rejection

and just to be sure I am setting it right I have tried 
HttpClient client.getParams().setCookiePolicy(CookiePolicy.IGNORE_COOKIES);
which does indeed ignore the cookies (but this is not what I want!).

But most browsers (in fact all I have tried) work with these cookies. 

So can I convince HttpMethodBase to work on these. - I know that I can parse 
them out myself and add them back in, but this seems wrong.

Cheers,
Karl.

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

Reply via email to