[Mono-devel-list] System.Web: Enable SessionState in HttpHandler (FrontController)

yoros at wanadoo.es yoros at wanadoo.es
Thu Jun 3 04:27:48 EDT 2004


Hi,

I'm using the FrontContrller pattern (described in MSDN web) using the
following option in "web.config":

    <httpHandlers>
        <add verb="*" path="*.ctrl" type="Handler, FrontController" />
    </httpHandlers>

I have the problem that in the Handler class the SessionStateo object is
not created (Session == null).

Something as follows:

-----------8<------------
using System;
using System.Web;
using System.Web.UI;
public class Handler : IHttpHandler {
    public void ProcessRequest (HttpContext context) {
		context.Response.Write("Is SessionState null? " + (context.Session == null).ToString());
    }
    public bool IsReusable  {
        get { return true; }
    }
}
-----------8<------------

To view the Session value:

mkdir FrontController
cd FrontController
cat << '__EOF__' >> FrontController.cs
using System;
using System.Web;
using System.Web.UI;
public class Handler : IHttpHandler {
    public void ProcessRequest (HttpContext context) {
		context.Response.Write("Is SessionState null? " + (context.Session == null).ToString());
    }
    public bool IsReusable  {
        get { return true; }
    }
}
__EOF__
cat << '__EOF__' >> web.config
<?xml version="1.0" encoding="utf-8"?>
<configuration>
    <system.web>
        <httpHandlers>
            <add verb="*" path="*.ctrl" type="Handler, FrontController" />
        </httpHandlers>
    </system.web>
</configuration>
__EOF__
cp /usr/local/bin/xsp.exe . # change /usr/local/bin with the path of xsp.exe
mkdir bin
mcs FrontController.cs /out:bin/FrontController.dll /target:library /r:System.Web.dll
./xsp.exe

Go to http://localhost:8080/something.ctrl in any browser...

Can anybody help me with this issue? Is it a bug?

Regards,

    Pedro

-- 
Pedro Martínez Juliá
\  pmj3 at alu.um.es
)|    yoros at wanadoo.es
/        http://yoros.dyndns.org
Socio HispaLinux #311
Usuario Linux #275438 - http://counter.li.org
GnuPG public information:  pub  1024D/74F1D3AC
Key fingerprint = 8431 7B47 D2B4 5A46 5F8E  534F 588B E285 74F1 D3AC



More information about the Mono-devel-list mailing list