From 1e9abfedfa7a858d89233088c503ebec4762b9fa Mon Sep 17 00:00:00 2001 From: Daniel Stenberg Date: Sat, 8 Dec 2018 17:29:55 +0100 Subject: cookies: expire "Max-Age=0" immediately Reported-by: Jeroen Ooms Fixes #3351 Closes #3352 --- lib/cookie.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) 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 -- cgit v1.2.1