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 Charles Johnson <cj...@cehjohnson.uklinux.net> on 2005/06/06 20:51:13 UTC
One cookie off
I'm fetching a page in a loop and seem to be receiving two cookies yet
only seeing one of them appear in the array when i call getCookies. You
can see a short extract of my log file here:
http://www.sigma-software.freeserve.co.uk/misc/FILE_TO_UPLOAD
This is what i'm doing in the code. 'client' is an instance variable.
client.getState().clear();
client.executeMethod(method);
cookies = client.getState().getCookies();
Why the discrepancy between the Set-Cookie headers and the number of
cookies in the array? Policy is set to CookiePolicy.BROWSER_COMPATIBILITY
---------------------------------------------------------------------
To unsubscribe, e-mail: httpclient-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: httpclient-user-help@jakarta.apache.org
Re: One cookie off
Posted by Charles Johnson <cj...@cehjohnson.uklinux.net>.
Thanks Roland.
CJ
Roland Weber wrote:
>Hello Charles,
>
>
>
>>What is the usual recourse when non-compliance occurs such as here?
>>
>>
>
>I guess you'll have to write your own cookie policy.
>
>cheers,
> Roland
>
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: httpclient-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: httpclient-user-help@jakarta.apache.org
Re: One cookie off
Posted by Roland Weber <RO...@de.ibm.com>.
Hello Charles,
> What is the usual recourse when non-compliance occurs such as here?
I guess you'll have to write your own cookie policy.
cheers,
Roland
Re: One cookie off
Posted by Charles Johnson <cj...@cehjohnson.uklinux.net>.
Thanks Roland - you appear to be correct:
>>
07/06/05 15:58:48,163 DEBUG - Error parsing cookie date
org.apache.commons.httpclient.util.DateParseException: Unable to parse
the date Sat
at org.apache.commons.httpclient.util.DateUtil.parseDate(Unknown Source)
at org.apache.commons.httpclient.util.DateUtil.parseDate(Unknown Source)
at
org.apache.commons.httpclient.cookie.CookieSpecBase.parseAttribute(Unknown
Source)
at org.apache.commons.httpclient.cookie.CookieSpecBase.parse(Unknown
Source)
at org.apache.commons.httpclient.cookie.CookieSpecBase.parse(Unknown
Source)
at
org.apache.commons.httpclient.HttpMethodBase.processResponseHeaders(Unknown
Source)
at org.apache.commons.httpclient.HttpMethodBase.readResponse(Unknown
Source)
at org.apache.commons.httpclient.HttpMethodBase.execute(Unknown Source)
at
org.apache.commons.httpclient.HttpMethodDirector.executeWithRetry(Unknown
Source)
at
org.apache.commons.httpclient.HttpMethodDirector.executeMethod(Unknown
Source)
at org.apache.commons.httpclient.HttpClient.executeMethod(Unknown
Source)
at org.apache.commons.httpclient.HttpClient.executeMethod(Unknown
Source)
at httpclient.code.UKBetting.saveRacePages(UKBetting.java:354)
at httpclient.code.UKBetting.getRacePages(UKBetting.java:256)
at httpclient.code.UKBetting.run(UKBetting.java:603)
at java.lang.Thread.run(Unknown Source)
>>
What is the usual recourse when non-compliance occurs such as here?
CJ
Roland Weber wrote:
>Hello Charles,
>
>since you are using the compatibility cookie policy, my next
>guess would be that the expiration date in the cookie causes
>problems. Year 3000 is way after the expected 32 bit overflow
>for the milliseconds in 2037. Java uses 64 bit to store the
>milliseconds, but who knows... The double semicolon could
>also cause problems while parsing the cookie, though I'm
>not familiar with the code. Have you tried to enable logging
>for the cookie policy?
>
>hope that helps,
> Roland
>
>
>
>
>
>Charles Johnson <cj...@cehjohnson.uklinux.net>
>06.06.2005 20:51
>Please respond to
>"HttpClient User Discussion"
>
>
>To
>HttpClient <ht...@jakarta.apache.org>
>cc
>
>Subject
>One cookie off
>
>
>
>
>
>
>I'm fetching a page in a loop and seem to be receiving two cookies yet
>only seeing one of them appear in the array when i call getCookies. You
>can see a short extract of my log file here:
>
>http://www.sigma-software.freeserve.co.uk/misc/FILE_TO_UPLOAD
>
>This is what i'm doing in the code. 'client' is an instance variable.
>
>client.getState().clear();
>client.executeMethod(method);
>cookies = client.getState().getCookies();
>
>Why the discrepancy between the Set-Cookie headers and the number of
>cookies in the array? Policy is set to CookiePolicy.BROWSER_COMPATIBILITY
>
>
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: httpclient-user-unsubscribe@jakarta.apache.org
>For additional commands, e-mail: httpclient-user-help@jakarta.apache.org
>
>
>
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: httpclient-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: httpclient-user-help@jakarta.apache.org
Re: One cookie off
Posted by Roland Weber <RO...@de.ibm.com>.
Hello Charles,
since you are using the compatibility cookie policy, my next
guess would be that the expiration date in the cookie causes
problems. Year 3000 is way after the expected 32 bit overflow
for the milliseconds in 2037. Java uses 64 bit to store the
milliseconds, but who knows... The double semicolon could
also cause problems while parsing the cookie, though I'm
not familiar with the code. Have you tried to enable logging
for the cookie policy?
hope that helps,
Roland
Charles Johnson <cj...@cehjohnson.uklinux.net>
06.06.2005 20:51
Please respond to
"HttpClient User Discussion"
To
HttpClient <ht...@jakarta.apache.org>
cc
Subject
One cookie off
I'm fetching a page in a loop and seem to be receiving two cookies yet
only seeing one of them appear in the array when i call getCookies. You
can see a short extract of my log file here:
http://www.sigma-software.freeserve.co.uk/misc/FILE_TO_UPLOAD
This is what i'm doing in the code. 'client' is an instance variable.
client.getState().clear();
client.executeMethod(method);
cookies = client.getState().getCookies();
Why the discrepancy between the Set-Cookie headers and the number of
cookies in the array? Policy is set to CookiePolicy.BROWSER_COMPATIBILITY
---------------------------------------------------------------------
To unsubscribe, e-mail: httpclient-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: httpclient-user-help@jakarta.apache.org