null Session object in HttpHandler

J

Jeremy Lew

When my HttpHandler is processing a request when installed on a particular
2003 Server machine, the Context.Session object is null. Any idea why this
might be? My handler implements IRequiresSessionState and works normally on
other machines.

Thanks,

Jeremy
 
I

Igor Kramaric

Jeremy,
in my case every server seems to be 'particular'. I mean, I never suceeded
to access session variables in HttpHandler.

E.g., I have Asp.Net application where I use Session as storage for some of
my objects. In my application I have certain folders (with html files)
configured to be handled with HttpHandler. There I never see the same
session as in the rest of the application. In fact session ID inside matches
(!), but IsNewSession is always equal to 'true', and Session is empty (there
are no values that I expect to find).

I was thinking maybe that the reason could be the configuration. Every
HttpHanlder is configured as application (in IIS console), so I was having a
doubt that this (separate) application has it's separate session. After I
tried to handle http request in my application root (thus having HttpHandler
and my main application as one) the same thing was occuring.


Any clue?

Igor


----- Original Message -----
From: "Jeremy Lew" <[email protected]>
Newsgroups: microsoft.public.dotnet.framework.aspnet
Sent: Saturday, September 25, 2004 5:30 PM
Subject: null Session object in HttpHandler
 
J

Jeremy Lew

I think your problem is different than mine. I have no Session object
period (Context.Session is null). Your problem sounds more like the browser
is not accepting cookies and therefore the session is not maintained in
between requests.
 
J

Jeremy Lew

For future generations of googlers, the answer is:

For a reason I haven't bothered to determine, the Session-state handling
HttpModule had been overridden in either a higher-level web.config or the
machine.config file. I had to add the following to my web.config to
re-assert that the usual set of handlers were in fact still added:

<httpModules>
<clear/>
<add name="OutputCache" type="System.Web.Caching.OutputCacheModule"/>
<add name="Session" type="System.Web.SessionState.SessionStateModule"/>
<add name="WindowsAuthentication"
type="System.Web.Security.WindowsAuthenticationModule"/>
<add name="FileAuthorization"
type="System.Web.Security.FileAuthorizationModule"/>
</httpModules>
 
I

Igor K

Thanx Jeremy,
my IE is accepting cookies, in the rest of the application everything works
well regarding session.

I have seen your post from 28OCT2004, nice that you solve it, maybe I should
also search some solution in that direction.

Bye,
Igor
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,054
Latest member
TrimKetoBoost

Latest Threads

Top