aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--lib/cookie.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/lib/cookie.c b/lib/cookie.c
index 96452abfd..fbf2ed0c4 100644
--- a/lib/cookie.c
+++ b/lib/cookie.c
@@ -347,7 +347,13 @@ Curl_cookie_add(struct CookieInfo *c,
/* the names are identical */
if(clist->domain && co->domain) {
- if(strequal(clist->domain, co->domain))
+ if(strequal(clist->domain, co->domain) ||
+ (clist->domain[0]=='.' &&
+ strequal(&(clist->domain[1]), co->domain)) ||
+ (co->domain[0]=='.' &&
+ strequal(clist->domain, &(co->domain[1]))) )
+ /* The domains are identical, or at least identical if you skip the
+ preceeding dot */
replace_old=TRUE;
}
else if(!clist->domain && !co->domain)