[Mono-bugs] [Bug 349564] HttpCookieCollection.Get does not create cookie if missing

bugzilla_noreply at novell.com bugzilla_noreply at novell.com
Tue Dec 18 12:46:24 EST 2007


https://bugzilla.novell.com/show_bug.cgi?id=349564

User miguel at novell.com added comment
https://bugzilla.novell.com/show_bug.cgi?id=349564#c4





--- Comment #4 from Miguel de Icaza <miguel at novell.com>  2007-12-18 10:46:24 MST ---
Ah, this might explain the difference.   

Thanks for the research, would you be able to test this patch?

Index: /cvs/mcs/class/System.Web/System.Web/HttpCookieCollection.cs
===================================================================
--- /cvs/mcs/class/System.Web/System.Web/HttpCookieCollection.cs       
(revision 91487)
+++ /cvs/mcs/class/System.Web/System.Web/HttpCookieCollection.cs       
(working copy)
@@ -137,7 +137,12 @@

                public HttpCookie Get (string name)
                {
-                       return (HttpCookie)BaseGet (name);
+                       HttpCookie cookie = (HttpCookie)BaseGet (name);
+                       if (!IsReadOnly && auto_fill && cookie == null) {
+                           cookie = new HttpCookie (name);
+                           BaseAdd (name, cookie);
+                       }
+                       return cookie;
                }


-- 
Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the QA contact for the bug.


More information about the mono-bugs mailing list