From db2d15bf93ef92670bea2b66ccb3b2c33473d4d7 Mon Sep 17 00:00:00 2001 From: Dan Winship Date: Fri, 3 Apr 2009 14:14:07 +0000 Subject: =?UTF-8?q?=09Bug=20577360=20=E2=80=93=20handle=20cookies=20with?= =?UTF-8?q?=20same=20name=20but=20different=20path?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * libsoup/soup-cookie-jar.c (soup_cookie_jar_add_cookie): check both name and path when matching cookies; "foo=one; path=/bar" should not replace "foo=two; path=/". They are separate cookies. Reported by Alexander V. Butenko. svn path=/trunk/; revision=1262 --- libsoup/soup-cookie-jar.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'libsoup/soup-cookie-jar.c') diff --git a/libsoup/soup-cookie-jar.c b/libsoup/soup-cookie-jar.c index bb0dca56..2c9e3e1f 100644 --- a/libsoup/soup-cookie-jar.c +++ b/libsoup/soup-cookie-jar.c @@ -345,7 +345,8 @@ soup_cookie_jar_add_cookie (SoupCookieJar *jar, SoupCookie *cookie) old_cookies = g_hash_table_lookup (priv->domains, cookie->domain); for (oc = old_cookies; oc; oc = oc->next) { old_cookie = oc->data; - if (!strcmp (cookie->name, old_cookie->name)) { + if (!strcmp (cookie->name, old_cookie->name) && + !g_strcmp0 (cookie->path, old_cookie->path)) { if (cookie->expires && soup_date_is_past (cookie->expires)) { /* The new cookie has an expired date, * this is the way the the server has -- cgit v1.2.1