I am a bit confused about the following: I set up an asp.net Website with some logic in the Session_Start() of the Global.asx. I expected that this even will only trigger once during a session. However the event fired with every single request.
When I declare a dummy session object this fixed the problem.
Also I can fix this problem when I add <sessionState mode="InProc" />
in the web.config. I use IIS7 and I checked the default value and this is already set to "In Process".
I am missing something? Is this normal behaviour? I was expecting this event to work even if I don't declare a session object.
I think this happens if the browser being used does not allow cookies. As well if you application pool is being restarted the session will be lost.
That will solve issues with cookies not being allowed..
Store something in a Session object.
http://blogs.msdn.com/b/nikhiln/archive/2007/06/21/detecting-session-timeout-in-asp-net-2-0-web-applications.aspx
You'd check: