]> granicus.if.org Git - curl/commitdiff
cookie: Don't expire session cookies in remove_expired
authorJay Satiro <raysatiro@yahoo.com>
Sat, 5 Mar 2016 18:35:17 +0000 (13:35 -0500)
committerJay Satiro <raysatiro@yahoo.com>
Sat, 5 Mar 2016 18:35:17 +0000 (13:35 -0500)
Prior to this change cookies with an expiry date that failed parsing
and were converted to session cookies could be purged in remove_expired.

Bug: https://github.com/curl/curl/issues/697
Reported-by: Seth Mos
lib/cookie.c

index 1fd97c013d754301cff281433e31aa31c6bacd1c..558b6a7f26c1b5be2deb7227fea09947d9b12a28 100644 (file)
@@ -309,7 +309,7 @@ static void remove_expired(struct CookieInfo *cookies)
   pv = NULL;
   while(co) {
     nx = co->next;
-    if((co->expirestr || co->maxage) && co->expires < now) {
+    if(co->expires && co->expires < now) {
       if(co == cookies->cookies) {
         cookies->cookies = co->next;
       }