aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Stenberg <daniel@haxx.se>2018-12-08 17:29:55 +0100
committerDaniel Stenberg <daniel@haxx.se>2018-12-09 18:34:55 +0100
commit1e9abfedfa7a858d89233088c503ebec4762b9fa (patch)
tree7959f07ce04ef0bd669c113c63626a5125a8fb6e
parentd997aa0e963c5be5de100dccdc5208d39bd3d62b (diff)
cookies: expire "Max-Age=0" immediately
Reported-by: Jeroen Ooms Fixes #3351 Closes #3352
-rw-r--r--lib/cookie.c5
1 files changed, 4 insertions, 1 deletions
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