svn path=/branches/mono-1-1-9/mcs/; revision=51206
[mono.git] / mcs / class / System / System.Net / CookieCollection.cs
index 3a123ef11d268b9d9044f310050d296a182064f6..6752230648890b4baab15c1ec905d1ef58c7fe89 100644 (file)
@@ -82,7 +82,7 @@ namespace System.Net
                        int pos = SearchCookie (cookie);
                        if (pos == -1)
                                list.Add (cookie);
-                       else 
+                       else
                                list [pos] = cookie;
                }
 
@@ -94,6 +94,9 @@ namespace System.Net
 
                        for (int i = list.Count - 1; i >= 0; i--) {
                                Cookie c = (Cookie) list [i];
+                               if (c.Version != cookie.Version)
+                                       continue;
+
                                if (0 != String.Compare (domain, c.Domain, true, CultureInfo.InvariantCulture))
                                        continue;