[Mono-bugs] [Bug 73345][Min] New - Request.Params.Get(CookieName) returns type name instead of cookie value
bugzilla-daemon@bugzilla.ximian.com
bugzilla-daemon@bugzilla.ximian.com
Fri, 4 Mar 2005 10:09:06 -0500 (EST)
Please do not reply to this email- if you want to comment on the bug, go to the
URL shown below and enter your comments there.
Changed by joe_audette@yahoo.com.
http://bugzilla.ximian.com/show_bug.cgi?id=73345
--- shadow/73345 2005-03-04 10:09:06.000000000 -0500
+++ shadow/73345.tmp.10689 2005-03-04 10:09:06.000000000 -0500
@@ -0,0 +1,155 @@
+Bug#: 73345
+Product: Mono: Class Libraries
+Version: 1.1
+OS: SUSE 9.2
+OS Details:
+Status: NEW
+Resolution:
+Severity:
+Priority: Minor
+Component: Sys.Web
+AssignedTo: mono-bugs@ximian.com
+ReportedBy: joe_audette@yahoo.com
+QAContact: mono-bugs@ximian.com
+TargetMilestone: ---
+URL:
+Cc:
+Summary: Request.Params.Get(CookieName) returns type name instead of cookie value
+
+Please fill in this template when reporting a bug, unless you know what you
+are doing.
+Description of Problem:
+I'm using revision 41322 from svn
+
+Retrieving the value of a cookie can be done using
+Request.Params.Get(CookieName) under Windows, but under mono this returns
+the type name "System.Web.HttpCookie"
+
+A simple workaround is to use
+Request.Cookies.Get(CookieName).Value
+
+
+Steps to reproduce the problem:
+Set a cookie and try to retrieve the value using Request.Params.Get(CookieName)
+
+See simple page code below in Additional Information section.
+
+Actual Results:
+
+"System.Web.HttpCookie"
+
+
+Expected Results:
+Value of the cookie named cookiename
+
+
+How often does this happen?
+every time
+
+
+Additional Information:
+Test Case Page:
+<%@ language="C#" %>
+<%@ import namespace="System.Data" %>
+<%@ import namespace="System.Data.SqlClient" %>
+<%@ import namespace="System.Reflection" %>
+
+<html>
+
+<script runat=server>
+
+ void Page_Load (object sender, EventArgs e)
+ {
+
+ }
+
+ private void btnSetCookie_Click(object sender, EventArgs e)
+ {
+ HttpCookie theCookie = new HttpCookie(this.txtCookieName.Text,
+this.txtCookieValue.Text);
+ Response.Cookies.Add(theCookie);
+
+ }
+
+ private void btnShowCookie_Click(object sender, EventArgs e)
+ {
+
+ lblCookieValue1.Text = Request.Params.Get(this.txtCookieName.Text);
+
+ lblCookieValue2.Text = Request.Cookies.Get(this.txtCookieName.Text).Value;
+
+ }
+
+
+ void Page_Init (object sender, EventArgs e)
+ {
+ this.btnSetCookie.Click += new System.EventHandler(this.btnSetCookie_Click);
+ this.btnShowCookie.Click += new
+System.EventHandler(this.btnShowCookie_Click);
+ this.Load += new System.EventHandler(this.Page_Load);
+
+ }
+
+
+
+
+
+</script>
+<head>
+<title>Cookie Tester</title>
+</head>
+<body>
+
+<form id="theForm" runat="server">
+
+<table>
+ <tr>
+ <th>
+ Cookie Name:
+ </th>
+ <td>
+ <asp:TextBox ID="txtCookieName" runat="server"></asp:TextBox>
+ </td>
+ </tr>
+ <tr>
+ <th>
+ Cookie Value:
+ </th>
+ <td>
+ <asp:TextBox ID="txtCookieValue" runat="server"></asp:TextBox>
+ </td>
+ </tr>
+ <tr>
+ <td colspan="2">
+ Cookie Value using Request.Params.Get(CookieName).Value
+ </td>
+
+ </tr>
+ <tr>
+ <td colspan="2">
+ <asp:Label ID="lblCookieValue1" ForeColor="red" runat="server"></asp:Label>
+ </td>
+ </tr>
+ <tr>
+ <td colspan="2">
+ Cookie Value using Request.Cookies.Get(CookieName);
+ </td>
+
+ </tr>
+ <tr>
+ <td colspan="2">
+ <asp:Label ID="lblCookieValue2" ForeColor="red" runat="server"></asp:Label>
+ </td>
+ </tr>
+ <tr>
+ <td colspan="2">
+ <asp:Button ID="btnSetCookie" runat="server" Text="Set Cookie"></asp:Button>
+ <asp:Button ID="btnShowCookie" runat="server" Text="Show
+Cookie"></asp:Button>
+ </td>
+ </tr>
+</table>
+
+</form>
+</body>
+</html>