]> granicus.if.org Git - curl/commit
cookies: support creation-time attribute for cookies
authorDaniel Gustafsson <daniel@yesql.se>
Tue, 28 Aug 2018 09:28:50 +0000 (11:28 +0200)
committerDaniel Stenberg <daniel@haxx.se>
Fri, 31 Aug 2018 12:11:37 +0000 (14:11 +0200)
commite2ef8d6fa11b2345e10b89db525920f2a0d5fd79
tree3be4fab33a03fcda3d398217511d5e4744dd546a
parentb842fa3110aa2ff1204fd9370d657bc5f1174ffb
cookies: support creation-time attribute for cookies

According to RFC6265 section 5.4, cookies with equal path lengths
SHOULD be sorted by creation-time (earlier first). This adds a
creation-time record to the cookie struct in order to make cookie
sorting more deterministic. The creation-time is defined as the
order of the cookies in the jar, the first cookie read fro the
jar being the oldest. The creation-time is thus not serialized
into the jar. Also remove the strcmp() matching in the sorting as
there is no lexicographic ordering in RFC6265. Existing tests are
updated to match.

Closes #2524
12 files changed:
lib/cookie.c
lib/cookie.h
tests/data/test1105
tests/data/test1136
tests/data/test1151
tests/data/test1216
tests/data/test1415
tests/data/test31
tests/data/test46
tests/data/test506
tests/data/test61
tests/data/test8