R
Rod
In Dino Esposito's book, "Programming Microsoft ASP.NET", there is a chapter
titled, "ASP.NET State Management". There is a section in there discussing
session state sometimes going away. He mentions that in version 1.1 of
ASP.NET, that it isn't possible for the application to know about the
session expiring. He gives a work around which you can try using that is
put into the Session_Start event, which would first determine if there
exists a cookie called "started_at". If there isn't, then the session was
never started, you create the cookie and then put DateTime.Now into it.
However, if the cookie has been created and you're still executing the
Session_Start event, then the session has expired. His code then does the
following:
Context.Response.Redirect("session_expired.aspx");
Now, I know that the name of the target page isn't important, but what I don
't understand is why he would recommend going to an ASPX page? I would have
thought that you would rather send the user to some HTML page instead. I am
sure I am missing something here, so please enlighten me.
Rod
titled, "ASP.NET State Management". There is a section in there discussing
session state sometimes going away. He mentions that in version 1.1 of
ASP.NET, that it isn't possible for the application to know about the
session expiring. He gives a work around which you can try using that is
put into the Session_Start event, which would first determine if there
exists a cookie called "started_at". If there isn't, then the session was
never started, you create the cookie and then put DateTime.Now into it.
However, if the cookie has been created and you're still executing the
Session_Start event, then the session has expired. His code then does the
following:
Context.Response.Redirect("session_expired.aspx");
Now, I know that the name of the target page isn't important, but what I don
't understand is why he would recommend going to an ASPX page? I would have
thought that you would rather send the user to some HTML page instead. I am
sure I am missing something here, so please enlighten me.
Rod