From: Daniel Stenberg Date: Sat, 8 Dec 2018 16:29:55 +0000 (+0100) Subject: cookies: expire "Max-Age=0" immediately X-Git-Tag: curl-7_63_0~16 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=1e9abfedfa7a858d89233088c503ebec4762b9fa;p=curl cookies: expire "Max-Age=0" immediately Reported-by: Jeroen Ooms Fixes #3351 Closes #3352 --- diff --git a/lib/cookie.c b/lib/cookie.c index d8655f790..3dc85ee5c 100644 --- a/lib/cookie.c +++ b/lib/cookie.c @@ -675,7 +675,10 @@ Curl_cookie_add(struct Curl_easy *data, /* overflow, used max value */ co->expires = CURL_OFF_T_MAX; else if(!offt) { - if(CURL_OFF_T_MAX - now < co->expires) + if(!co->expires) + /* already expired */ + co->expires = 1; + else if(CURL_OFF_T_MAX - now < co->expires) /* would overflow */ co->expires = CURL_OFF_T_MAX; else