summaryrefslogtreecommitdiff
path: root/libsoup/soup-cookie-jar.c
diff options
context:
space:
mode:
authorDan Winship <danw@src.gnome.org>2009-04-03 14:14:07 +0000
committerDan Winship <danw@src.gnome.org>2009-04-03 14:14:07 +0000
commitdb2d15bf93ef92670bea2b66ccb3b2c33473d4d7 (patch)
treeaa1e913d21cddab7912cde279ea1e80621f2c28d /libsoup/soup-cookie-jar.c
parentc52349db64251ea443d9544a327ebf95a35d8fe8 (diff)
downloadlibsoup-db2d15bf93ef92670bea2b66ccb3b2c33473d4d7.tar.gz
Bug 577360 – handle cookies with same name but different path
* 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
Diffstat (limited to 'libsoup/soup-cookie-jar.c')
-rw-r--r--libsoup/soup-cookie-jar.c3
1 files changed, 2 insertions, 1 deletions
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