cookie Kludge

Discussion in 'Java' started by Roedy Green, May 17, 2012.

  1. Roedy Green

    Roedy Green Guest

    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.
    ..
     
    Roedy Green, May 17, 2012
    #1
    1. Advertising

  2. Roedy Green

    Daniel Pitts Guest

    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.
     
    Daniel Pitts, May 17, 2012
    #2
    1. Advertising

  3. Roedy Green

    Roedy Green Guest

    On Thu, 17 May 2012 09:17:14 -0700, Daniel Pitts
    <> 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.
    --
    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.
    ..
     
    Roedy Green, May 17, 2012
    #3
  4. Roedy Green

    Daniel Pitts Guest

    On 5/17/12 2:32 PM, Roedy Green wrote:
    > On Thu, 17 May 2012 09:17:14 -0700, Daniel Pitts
    > <> 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.
     
    Daniel Pitts, May 17, 2012
    #4
  5. Roedy Green

    Roedy Green Guest

    On Thu, 17 May 2012 15:03:42 -0700, Daniel Pitts
    <> 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.
    --
    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.
    ..
     
    Roedy Green, May 19, 2012
    #5
  6. Roedy Green

    Daniel Pitts Guest

    On 5/19/12 4:16 AM, Roedy Green wrote:
    > On Thu, 17 May 2012 15:03:42 -0700, Daniel Pitts
    > <> 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 ;-)
     
    Daniel Pitts, May 20, 2012
    #6
  7. Roedy Green

    Arne Vajhøj Guest

    On 5/17/2012 6:03 PM, Daniel Pitts wrote:
    > On 5/17/12 2:32 PM, Roedy Green wrote:
    >> On Thu, 17 May 2012 09:17:14 -0700, Daniel Pitts
    >> <> 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.


    Just as good.

    Just frustrating that they changed the API.

    Arne
     
    Arne Vajhøj, May 20, 2012
    #7
  8. Roedy Green

    Arne Vajhøj Guest

    On 5/19/2012 7:16 AM, Roedy Green wrote:
    > On Thu, 17 May 2012 15:03:42 -0700, Daniel Pitts
    > <> 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
     
    Arne Vajhøj, May 20, 2012
    #8
  9. Roedy Green

    Roedy Green Guest

    On Sat, 19 May 2012 17:35:37 -0700, Daniel Pitts
    <> 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.
    ..
     
    Roedy Green, May 26, 2012
    #9
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Ben
    Replies:
    3
    Views:
    5,936
    Steven Cheng[MSFT]
    Jun 3, 2004
  2. Shapper

    Cookie and Session Cookie Questions.

    Shapper, Apr 27, 2005, in forum: ASP .Net
    Replies:
    1
    Views:
    613
  3. =?Utf-8?B?UGF1bA==?=

    Cookie Question (IP as domain and cookie file location)

    =?Utf-8?B?UGF1bA==?=, Jan 10, 2006, in forum: ASP .Net
    Replies:
    1
    Views:
    2,541
    Bruce Barker
    Jan 10, 2006
  4. Kyler Laird
    Replies:
    0
    Views:
    337
    Kyler Laird
    Dec 27, 2003
  5. Ian Semmel

    Is ASP.NET a Kludge ?

    Ian Semmel, Oct 14, 2007, in forum: ASP .Net
    Replies:
    3
    Views:
    343
    clintonG
    Oct 15, 2007
Loading...

Share This Page