[Mono-dev] [PATCH]enableSessionState ReadOnly bugfix

Joel Reed joelwreed at gmail.com
Thu Aug 9 17:17:19 EDT 2007

Btw, I filled a bug for this.



-----Original Message-----
From: Joel Reed
Sent: Thu, Aug 09, 2007 at 04:07:20PM -0400
To: To mono-devel
Subject: [PATCH]enableSessionState ReadOnly bugfix

Given a web.config with:

  <pages enableSessionState="ReadOnly" ...

And a web page with: 

  <%@ Page Language="C#" %>
  <% Response.Write("IsReadOnly = " + Session.IsReadOnly.ToString()); %>

The Response.Write will report back "false". There are two bugs
in System.Web.UI/PageParser.cs that prevents this from working.

First, we must properly propagate the page config setting to the page
parser (see hunk 2 of attached diff).

Second, when we check the EnableSessionState page directive we
must not mess with the page config settings if no such page
directive was provided (see hunk 3).

Hunk 3 looks big but the important change is just the line:

  if (atts.ContainsKey("EnableSessionState")) {

Is the attached patch acceptable to apply? I'm not sure hunk 1 is
really required but it felt better to be explicit about
readonlySessionState's initial state.


More information about the Mono-devel-list mailing list