472,960 Members | 1,885 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,960 software developers and data experts.

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 2020
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Bogdan Fiedur | last post by:
Hi Everybody, When we defined this section in web.config in the main root, <httpModules> <add name="ApplicationModule" type="Myspace.Community.ApplicationModule,Community" />...
11
by: Markus Kling | last post by:
Hi, I have a web application that has two sub-applications. The root application defines two httpModules which shall not be loaded for the subapplications. I tried to achieve this by adding ...
0
by: tshad | last post by:
I noticed in my Http modules that all the BeginRequests are handled for each Module before the EndRequests is handled (at least that seems to be the case). I have 2 HttpModules each with...
1
by: Anonieko | last post by:
Global.asax? Use HttpModules Instead! In a previous post, I talked about HttpHandlers - an underused but incredibly useful feature of ASP.NET. Today I want to talk about HttpModules, which are...
1
by: Asela Gunawardena | last post by:
Hi all, we have a webservice as a seperate virtual directory placed under a Web Site named GRSCS in IIS. Both are .NET applications and uses MS application blocks as the data layer. Recently an...
2
by: Mikael Syska | last post by:
Hi, Google gives alot of hits on httpmodules but I can't seem to find any useful on my problem ... I have a site where I'm using my own auth system ... ( guess it could be better but its...
3
by: =?Utf-8?B?Tm9yZW1hYw==?= | last post by:
Hi, We are writing a Web SSO service for all of our websites through Forms Authentication. We also want to provide our websites with the ability to protect different parts of their website and...
1
by: Samuel R. Neff | last post by:
We have a problem with Web.config inheritance in two of our applications. We have an old app which is poorly written and must be in the root of the server. We have a newer app which runs from a...
2
by: DamienS | last post by:
Hi, I'm trying to get away from using global.asax for reasons of 'neatness'. Am I able to register a HTTPModule that captures the starting of a user session? Isn't Session_Start an event in...
2
by: DJRhino | last post by:
Was curious if anyone else was having this same issue or not.... I was just Up/Down graded to windows 11 and now my access combo boxes are not acting right. With win 10 I could start typing...
2
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 4 Oct 2023 starting at 18:00 UK time (6PM UTC+1) and finishing at about 19:15 (7.15PM) The start time is equivalent to 19:00 (7PM) in Central...
0
by: Aliciasmith | last post by:
In an age dominated by smartphones, having a mobile app for your business is no longer an option; it's a necessity. Whether you're a startup or an established enterprise, finding the right mobile app...
4
NeoPa
by: NeoPa | last post by:
Hello everyone. I find myself stuck trying to find the VBA way to get Access to create a PDF of the currently-selected (and open) object (Form or Report). I know it can be done by selecting :...
1
by: Teri B | last post by:
Hi, I have created a sub-form Roles. In my course form the user selects the roles assigned to the course. 0ne-to-many. One course many roles. Then I created a report based on the Course form and...
3
by: nia12 | last post by:
Hi there, I am very new to Access so apologies if any of this is obvious/not clear. I am creating a data collection tool for health care employees to complete. It consists of a number of...
0
NeoPa
by: NeoPa | last post by:
Introduction For this article I'll be focusing on the Report (clsReport) class. This simply handles making the calling Form invisible until all of the Reports opened by it have been closed, when it...
0
isladogs
by: isladogs | last post by:
The next online meeting of the Access Europe User Group will be on Wednesday 6 Dec 2023 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, Mike...
2
by: GKJR | last post by:
Does anyone have a recommendation to build a standalone application to replace an Access database? I have my bookkeeping software I developed in Access that I would like to make available to other...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.