Hello experts,
in my asp.vb.net web application I need to check if a timeout has occured.
In that case I want to read a session variable containing the name of the user who is currently logged in
(I'm setting this variable during login to my web application)
and reset the user's flag in my database
and create a proper web page to inform the user that a timeout has occured.
The information about the users is held in the database
and my application works OK in all cases except the timeout.
I'm using Visual Studio.Net 2002 with W2K (IIS 5.0) or XP (IIS 5.1)
and Visual Studio.Net 2003 with Server 2003 (IIS 6.0).
Are there "well-known" differences concerning timeouts?
I expected that the routine Session_End (or Session_OnEnd ?) can be used
to control the timeout event properly.
That also works in a debugging environment using one user.
But if I'm testing with more than one user,
the results are not consistent.
I'm also wondering that during the login to my web application
the routines Session_Start and sometimes Session_End get activated.
I did not found sufficient information in the web.
Currently I check in my web pages that a timeout has occured as follows:
I try reading an always in normal processing properly filled session variable.
If this fails, I assume that a timeout has occured.
Cause: During timeout the contents of all session variables get lost.
That also means that my session variable with the user information got lost.
How can I manage that in the timeout routine I re-set this session variable again
to ensure that the proper user information is available
for the case that the I detect in my web pages that the reading of my special session variable failed?
Or - is there a better way to detect that a timeout has occured?
But I think, I need a consistent mechanism to make the contents of a session variable surviving a timeout.
Does anyone know how I can manage this?
Appropriate code snippets are most welcome.
Thank you for any help.
HStrix