473,563 Members | 2,695 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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, IRequiresSessio nState
{}

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 2043
Hi,

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

So from HttpModule's standpoint, Session is available after
AcquireRequestS tate 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 AcquireRequestS tate 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******** *****@TK2MSFTNG P09.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, IRequiresSessio nState
{}

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****@aspalli ance.com> a écrit dans le message de news:
uP************* *@TK2MSFTNGP09. phx.gbl...
Hi,

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

So from HttpModule's standpoint, Session is available after
AcquireRequestS tate 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 AcquireRequestS tate 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******** *****@TK2MSFTNG P09.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, IRequiresSessio nState
{}

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
1546
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" /> </httpModules
11
1541
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 <httpmodules> <clear /> </httpmodules>
0
1163
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 BeginRequests and EndRequests. <httpModules> <add type="NFission.WebControls.ScrollKeeperModule,NFission.WebControls.ScrollKeeper"...
1
3274
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 probably more common than HttpHandlers, but could still stand to be advertised a bit more. HttpModules are incredibly easy to explain, so this will...
1
1917
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 http module was included in the root site which is GRSCS and the webservice has not functioned ever since. the service starts working when u comment...
2
2387
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 work, maybe I will make a new one later, or use the build -in ) But to my problem ... I have a Admin area, but that users dont have
3
2124
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 redirect to different registration pages. We are also required to centrally audit authorization failures to a database only the Web SSO people can...
1
3183
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 virtual directory. The apps are not related. Old app web.config has: <httpModules> <add name="a" type="foo.a, foo" /> <add name="b"...
2
2093
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 global.asax? ... and isn't global.asax exposing events of HttpApplication? What am I missing?
0
7664
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
0
7583
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language...
0
8106
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
1
7638
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
0
7948
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
1
5484
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
0
3642
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
0
3626
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
1198
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.