468,247 Members | 1,318 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 468,247 developers. It's quick & easy.

HttpModules et session

Hi,

I have create a httpmodule but I have some problems. I can't access to the
session. Even if I create my class like this
public class myModule: IHttpModule, IRequiresSessionState
{}

Someone got an idea?
Another question, the session_start in Global.asax fire before all
httpmodules or after all ?!?

Thanks.
Aurel
Nov 18 '05 #1
2 1892
Hi,

first of: IRequiresSessionState is to be used with HttpHandlers (Classes
implementing IHttpHandler interface) to tell that they need Session to be
usable (read/write) and IReadOnlySessionState if HttpHandler needs only
read-only access to the Session. This different fconcept from HttpModules.

So from HttpModule's standpoint, Session is available after
AcquireRequestState event of the HttpApplication is raised. before that you
can't access the Session. It means that in your module you can wire an event
handler in Init method for AcquireRequestState event or some later event to
get access to the Session collection.

Check following article:
http://www.eggheadcafe.com/articles/20030211.asp

It provides you the list and sequence of HttpApplication's events.

--
Teemu Keiski
MCP, Microsoft MVP (ASP.NET), AspInsiders member
ASP.NET Forum Moderator, AspAlliance Columnist


"Aurel" <We**************@hotmail.com> wrote in message
news:uU*************@TK2MSFTNGP09.phx.gbl...
Hi,

I have create a httpmodule but I have some problems. I can't access to the
session. Even if I create my class like this
public class myModule: IHttpModule, IRequiresSessionState
{}

Someone got an idea?
Another question, the session_start in Global.asax fire before all
httpmodules or after all ?!?

Thanks.
Aurel

Nov 18 '05 #2
Thanks to you, I think that I've no more problems ;-)

Thanks
Aurel
"Teemu Keiski" <jo****@aspalliance.com> a écrit dans le message de news:
uP**************@TK2MSFTNGP09.phx.gbl...
Hi,

first of: IRequiresSessionState is to be used with HttpHandlers (Classes
implementing IHttpHandler interface) to tell that they need Session to be
usable (read/write) and IReadOnlySessionState if HttpHandler needs only
read-only access to the Session. This different fconcept from HttpModules.

So from HttpModule's standpoint, Session is available after
AcquireRequestState event of the HttpApplication is raised. before that you can't access the Session. It means that in your module you can wire an event handler in Init method for AcquireRequestState event or some later event to get access to the Session collection.

Check following article:
http://www.eggheadcafe.com/articles/20030211.asp

It provides you the list and sequence of HttpApplication's events.

--
Teemu Keiski
MCP, Microsoft MVP (ASP.NET), AspInsiders member
ASP.NET Forum Moderator, AspAlliance Columnist


"Aurel" <We**************@hotmail.com> wrote in message
news:uU*************@TK2MSFTNGP09.phx.gbl...
Hi,

I have create a httpmodule but I have some problems. I can't access to the session. Even if I create my class like this
public class myModule: IHttpModule, IRequiresSessionState
{}

Someone got an idea?
Another question, the session_start in Global.asax fire before all
httpmodules or after all ?!?

Thanks.
Aurel


Nov 18 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

1 post views Thread by Bogdan Fiedur | last post: by
11 posts views Thread by Markus Kling | last post: by
reply views Thread by tshad | last post: by
1 post views Thread by Anonieko | last post: by
2 posts views Thread by Mikael Syska | last post: by
3 posts views Thread by =?Utf-8?B?Tm9yZW1hYw==?= | last post: by
1 post views Thread by Samuel R. Neff | last post: by
2 posts views Thread by DamienS | last post: by
reply views Thread by NPC403 | last post: by
reply views Thread by kermitthefrogpy | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.