cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: http-state and cookie order

From: Daniel Stenberg <daniel_at_haxx.se>
Date: Tue, 13 Apr 2010 08:49:48 +0200 (CEST)

On Tue, 13 Apr 2010, Claes Jakobsson wrote:

> Another way we could store this is as a comment line with some formating
> following or preceding the cookie
>
> These comments will simply be ignored by other implementations and older
> curl. And if we don't see a creating time comment, well.. then I suppose
> epoch will do. It's a tiny bit more work than using a separation character
> but it's less likely to cause any compat issues.

Right, that would work but would be a bit more painful to parse since it'd
require the parser to do two different line formats and remember for what
cookie the time entry is for etc.

I also got a really good idea from Micah Cowan (ex wget maintainer) when I
talked to #wget about this (as they suffer from the exact same problem): we
can just make sure to save cookies in the file in time order, with the oldest
first. When we load cookies (or even receiver over the wire) we just bump a
counter and store that for each cookie and thus we will always know which is
the oldest and which is newer, without actually storing the info in the file -
as we don't need the exact number!

I'm very attracted to that idea as it maintains the file format unmodified and
yet should be able to sort the cookies as the RFC will mandate...

-- 
  / daniel.haxx.se
-------------------------------------------------------------------
List admin: http://cool.haxx.se/list/listinfo/curl-library
Etiquette:  http://curl.haxx.se/mail/etiquette.html
Received on 2010-04-13