Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

cookie Kludge

44 views
Skip to first unread message

Roedy Green

unread,
May 17, 2012, 12:50:32 AM5/17/12
to
kobobooks.com is sending me an invalid cookie:

SEVERE: Invalid cookie for
http://www.kobobooks.com/ebook/Decision-Points/book-L_0PHOGZzEGV0pcIxTh5H
w/page1.html: version=f8fbc7aaf4a7f76c93040ef8de748cc34775e4db;
domain=.kobobooks.com; expires=Fri,
18-May-2012 04:47:05 GMT; path=/

I think the problem is version is a reserved keyword that should be
set to 1.

I tried writing a CookiePolicy.shouldAccept but the bad cookie never
gets that far.

I wrote Kobo. Have not heard back.

How can I ignore the cookie? i.e. suppress the SEVERE: error message.
--
Roedy Green Canadian Mind Products
http://mindprod.com
Plants" with "leaves" no more efficient than today’s solar cells
could out-compete real plants, crowding the biosphere with an
inedible foliage. Tough omnivorous "bacteria" could out-compete
real bacteria: They could spread like blowing pollen, replicate
swiftly, and reduce the biosphere to dust in a matter of days.
Dangerous replicators could easily be too tough, small, and
rapidly spreading to stop -- at least if we make no preparation.
We have trouble enough controlling viruses and fruit flies.
~ Eric Drexler (born: 1955-04-25 age: 57)
Engines of Creation: The Coming Era of Nanotechnology.
.

Daniel Pitts

unread,
May 17, 2012, 12:17:14 PM5/17/12
to
On 5/16/12 9:50 PM, Roedy Green wrote:
> kobobooks.com is sending me an invalid cookie:
>
> SEVERE: Invalid cookie for
> http://www.kobobooks.com/ebook/Decision-Points/book-L_0PHOGZzEGV0pcIxTh5H
> w/page1.html: version=f8fbc7aaf4a7f76c93040ef8de748cc34775e4db;
> domain=.kobobooks.com; expires=Fri,
> 18-May-2012 04:47:05 GMT; path=/
>
> I think the problem is version is a reserved keyword that should be
> set to 1.
>
> I tried writing a CookiePolicy.shouldAccept but the bad cookie never
> gets that far.
>
> I wrote Kobo. Have not heard back.
>
> How can I ignore the cookie? i.e. suppress the SEVERE: error message.
There are many frameworks for making HTTP requests. A hint on which one
you're using might make it easier to help you.


Roedy Green

unread,
May 17, 2012, 5:32:47 PM5/17/12
to
On Thu, 17 May 2012 09:17:14 -0700, Daniel Pitts
<newsgrou...@virtualinfinity.net> wrote, quoted or indirectly
quoted someone who said :

>There are many frameworks for making HTTP requests. A hint on which one
>you're using might make it easier to help you.

The cookies are handled by

CookieHandler.setDefault( new CookieManager( null /* in ram store */,
new NoKobo() ) );

The GETs are done with HttpURLConnection with my own HTTP thin wrapper
and around it.

Daniel Pitts

unread,
May 17, 2012, 6:03:42 PM5/17/12
to
On 5/17/12 2:32 PM, Roedy Green wrote:
> On Thu, 17 May 2012 09:17:14 -0700, Daniel Pitts
> <newsgrou...@virtualinfinity.net> wrote, quoted or indirectly
> quoted someone who said :
>
>> There are many frameworks for making HTTP requests. A hint on which one
>> you're using might make it easier to help you.
>
> The cookies are handled by
>
> CookieHandler.setDefault( new CookieManager( null /* in ram store */,
> new NoKobo() ) );
>
> The GETs are done with HttpURLConnection with my own HTTP thin wrapper
> and around it.

I seem to recall Java's built in URLConnection stuff is actually very
bad at handling Cookies in a meaningful way. I tend to use apache
commons httpclient instead. I haven't used the new httpcore, so I'm not
sure how good it is compared.

Roedy Green

unread,
May 19, 2012, 7:16:15 AM5/19/12
to
On Thu, 17 May 2012 15:03:42 -0700, Daniel Pitts
<newsgrou...@virtualinfinity.net> wrote, quoted or indirectly
quoted someone who said :

>I seem to recall Java's built in URLConnection stuff is actually very
>bad at handling Cookies in a meaningful way. I tend to use apache
>commons httpclient instead. I haven't used the new httpcore, so I'm not
>sure how good it is compared.
Thanks. I thought Apache was just a wrapper on URLConnection

I am trying to fix it the easy way first by getting kobo to generate
proper cookies.

Daniel Pitts

unread,
May 19, 2012, 8:35:37 PM5/19/12
to
On 5/19/12 4:16 AM, Roedy Green wrote:
> On Thu, 17 May 2012 15:03:42 -0700, Daniel Pitts
> <newsgrou...@virtualinfinity.net> wrote, quoted or indirectly
> quoted someone who said :
>
>> I seem to recall Java's built in URLConnection stuff is actually very
>> bad at handling Cookies in a meaningful way. I tend to use apache
>> commons httpclient instead. I haven't used the new httpcore, so I'm not
>> sure how good it is compared.
> Thanks. I thought Apache was just a wrapper on URLConnection
Nope, The Apache commons stuff is a low-level implementation, which
gives you better "hooks" into some of the more advanced features of the
HTTP protocol.
> I am trying to fix it the easy way first by getting kobo to generate
> proper cookies.
Delegation is often good first option. Good luck with third parties
though ;-)

Arne Vajhøj

unread,
May 19, 2012, 9:46:43 PM5/19/12
to
Just as good.

Just frustrating that they changed the API.

Arne

Arne Vajhøj

unread,
May 19, 2012, 9:53:37 PM5/19/12
to
On 5/19/2012 7:16 AM, Roedy Green wrote:
> On Thu, 17 May 2012 15:03:42 -0700, Daniel Pitts
> <newsgrou...@virtualinfinity.net> wrote, quoted or indirectly
> quoted someone who said :
>> I seem to recall Java's built in URLConnection stuff is actually very
>> bad at handling Cookies in a meaningful way. I tend to use apache
>> commons httpclient instead. I haven't used the new httpcore, so I'm not
>> sure how good it is compared.

> Thanks. I thought Apache was just a wrapper on URLConnection

That would be obvious.

But actually HttpClient build directly on top of Socket.

I am sure that they must have tried HttpURLConnection, but
somehow concluded that they could not do what they want with it.

Arne

Roedy Green

unread,
May 26, 2012, 4:34:06 AM5/26/12
to
On Sat, 19 May 2012 17:35:37 -0700, Daniel Pitts
<newsgrou...@virtualinfinity.net> wrote, quoted or indirectly
quoted someone who said :

>> I am trying to fix it the easy way first by getting kobo to generate
>> proper cookies.
>Delegation is often good first option. Good luck with third parties
>though ;-)

no luck so far.
--
Roedy Green Canadian Mind Products
http://mindprod.com
I would be quite surprised if the NSA (National Security Agency)
did not have a computer program to scan bits of shredded
documents and electronically put them back together like a giant
jigsaw puzzle. This suggests you cannot just shred, you must also burn.
.
0 new messages