0
votes

I am working on an ASP.Net web forms application.

I want the site to timeout after a certain period, which should be simple, however, I cannot seem to get this to happen as expected.

I have tried changing the timeout settings in web.config, as well as in IIS. I am in SQLServer Session Mode.

Code written in the Session_End function of the Global.asax file never executes, regardless of what settings I use for timeout.

Examining the session cookie and ASPStateTempSessions table in SQL Server indicate that the settings that I am changing in web.config are indeed changing the timeout values of the session, however, there is never anything to suggest that the site is ACTUALLY timing out.

I do not know where else to look for timeout settings, or what may be preventing me from generating a timeout.

1

1 Answers

0
votes

Out of process session state does not cause Session_End to fire, only in-process as explained in the answer to this question - Why Session_End event not raised when StateProvider is not InProc?

If you need to do something after 20 minutes of inactivity (for example) when using the SQL or State Server session provider, you will need to create your own mechanism. There's a link in the question above that explains how to do this - http://www.codeproject.com/KB/aspnet/SessionEndStatePersister.aspx