https://bugzilla.novell.com/show_bug.cgi?id=349564
User [EMAIL PROTECTED] added comment https://bugzilla.novell.com/show_bug.cgi?id=349564#c3 --- Comment #3 from Luca Leonardo Scorcia <[EMAIL PROTECTED]> 2007-12-18 10:33:57 MST --- I can confirm it happens on web pages, since I found it while testing an existing web site and it gave me a nice NullReferenceException. I tried your code in an empty web project and fails, BUT when I'm using Response.Cookies.Get("Dingus") it works. So maybe the MS runtime treats the object differently when it's main pages' cookie collection. I've been however investigating more, and I have found an incoherence in MSDN documentation: the this[string] property does not say that it should create the item when missing, but indeed it does. When looking at the source for Mono's this[string] property, it behaves correctly: public HttpCookie this [string name] { get { HttpCookie cookie = (HttpCookie)BaseGet (name); if (!IsReadOnly && auto_fill && cookie == null) { cookie = new HttpCookie (name); BaseAdd (name, cookie); } return cookie; } } So the fix could probably just be: public HttpCookie this [string name] { get { return this.Get(name); } } public HttpCookie Get(string name) { HttpCookie cookie = (HttpCookie)BaseGet (name); if (!IsReadOnly && auto_fill && cookie == null) { cookie = new HttpCookie (name); BaseAdd (name, cookie); } return cookie; } But there's definitely something obscure here. -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are the QA contact for the bug. _______________________________________________ mono-bugs maillist - [email protected] http://lists.ximian.com/mailman/listinfo/mono-bugs
