[Mono-bugs] [Bug 437289] New: with EnableSessionState="False" access to Context. ApplicationInstance.Session; should throw an exception

bugzilla_noreply at novell.com bugzilla_noreply at novell.com
Tue Oct 21 08:24:31 EDT 2008


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


           Summary: with EnableSessionState="False" access to
                    Context.ApplicationInstance.Session; should throw an
                    exception
           Product: Mono: Class Libraries
           Version: 2.0
          Platform: Other
        OS/Version: Other
            Status: NEW
          Severity: Normal
          Priority: P5 - None
         Component: Sys.Web
        AssignedTo: mhabersack at novell.com
        ReportedBy: informatique.internet at fiducial.fr
         QAContact: mono-bugs at lists.ximian.com
          Found By: ---


Hi,

I've found a little differences between MS.NET 1.1 and mono 2.0 (i'm getting
the problem in svn as well)

Try this aspx :

<%@ Page Language="C#"  EnableSessionState="False" enableViewState="False" %>

<script runat="server">

        protected override void OnLoad(System.EventArgs e)

        {

                try {

                HttpSessionState session=Context.ApplicationInstance.Session;

                        if (session==null)

                        {

                                Response.Write("Session is null");      

                        }

                }catch (Exception ex)

                {

                        Response.Write(ex.ToString());  

                }



                        Response.Write("<br /><br />");



                try {

                HttpSessionState session=Context.Session;

                        if (session==null)

                        {

                                Response.Write("Session is null");      

                        }

                }catch (Exception ex)

                {

                        Response.Write(ex.ToString());  

                }

        }

</script>





run xsp : 

On mono 2.0 you'll get :
Session is null

Session is null 



The first "Session is null" is not normal... the second is ok...

On MS.NET 1.1 you'll get : 
System.Web.HttpException: État de session non disponible dans ce contexte.

   at System.Web.HttpApplication.get_Session()

   at ASP.test_aspx.OnLoad(EventArgs e) in
c:\inetpub\wwwroot\nodeweb\test.aspx:line 6

Session is null



In fact, it seems that accessing Application.Session should throw an exception
but note that accessing Context.Session is authorized in MS.NET too...

Thanks for fixing this...


-- 
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