[Mono-bugs] [Bug 553150] New: HttpCookieCollection.Add does not allow overwriting existing cookies

bugzilla_noreply at novell.com bugzilla_noreply at novell.com
Fri Nov 6 00:52:43 EST 2009


http://bugzilla.novell.com/show_bug.cgi?id=553150


           Summary: HttpCookieCollection.Add does not allow overwriting
                    existing cookies
    Classification: Mono
           Product: Mono: Class Libraries
           Version: 2.4.x
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: Normal
          Priority: P5 - None
         Component: Sys.Web
        AssignedTo: mhabersack at novell.com
        ReportedBy: novell at nathan.qgl.org
         QAContact: mono-bugs at lists.ximian.com
          Found By: ---


User-Agent:       Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.0.14)
Gecko/2009090217 Ubuntu/9.04 (jaunty) Firefox/3.0.14

>From Mono's HttpCookieCollection:

    public void Add (HttpCookie cookie)
        {
            if (BaseGet (cookie.Name) != null)
                return;

            BaseAdd (cookie.Name, cookie);
        }

So, calling Add() twice with the same cookie name, the second call is ignored. 

NET does not do this - calling Add() twice with the same name is not special,
and just results in two Set-Cookie HTTP headers with the same name - which
effectively lets the second Add() override the first)

Reproducible: Always

Steps to Reproduce:
Create an .aspx file

<%
Response.Cookies.Add(new HttpCookie("test", "value1"));
Response.Cookies.Add(new HttpCookie("test", "value2"));
%>

Examine HTTP headers
Actual Results:  
Single line

Set-Cookie: test=value1

Expected Results:  
Both lines

Set-Cookie: test=value1
Set-Cookie: test=value2

-- 
Configure bugmail: http://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