From e2ef8d6fa11b2345e10b89db525920f2a0d5fd79 Mon Sep 17 00:00:00 2001 From: Daniel Gustafsson Date: Tue, 28 Aug 2018 11:28:50 +0200 Subject: 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 --- tests/data/test1415 | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'tests/data/test1415') diff --git a/tests/data/test1415 b/tests/data/test1415 index 560440407..f5660ba66 100644 --- a/tests/data/test1415 +++ b/tests/data/test1415 @@ -66,10 +66,10 @@ Proxy-Connection: Keep-Alive # https://curl.haxx.se/docs/http-cookies.html # This file was generated by libcurl! Edit at your own risk. -.example.com TRUE / FALSE 0 test1value test1 -.example.com TRUE / FALSE 2114380800 test2value test2 -.example.com TRUE / FALSE 2114380800 test4value test4 .example.com TRUE / FALSE 2114380800 test7value test7 +.example.com TRUE / FALSE 2114380800 test4value test4 +.example.com TRUE / FALSE 2114380800 test2value test2 +.example.com TRUE / FALSE 0 test1value test1 -- cgit v1.2.3