libsoup r1262 - in trunk: . libsoup



Author: danw
Date: Fri Apr  3 14:14:07 2009
New Revision: 1262
URL: http://svn.gnome.org/viewvc/libsoup?rev=1262&view=rev

Log:
	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.


Modified:
   trunk/ChangeLog
   trunk/libsoup/soup-cookie-jar.c

Modified: trunk/libsoup/soup-cookie-jar.c
==============================================================================
--- trunk/libsoup/soup-cookie-jar.c	(original)
+++ trunk/libsoup/soup-cookie-jar.c	Fri Apr  3 14:14:07 2009
@@ -345,7 +345,8 @@
 	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



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]