Detecting Session and/or Authentication Timeout
Posted on 2006-04-26
I have an ASP.NET application which is configured for Forms-based Authentication and has a simple Login.aspx page. If a user's session or authentication times out, clicking on any of the application's links takes them immediately to the Login page. This is fine, I can always adjust the timeout values if it gets too annoying.
However, I would like to display a message telling them what happened ("Sorry, your session timed out. Please log in again.") because I'm sure there will be some (many?) users scratching their heads when this happens. Is there a way to detect that the login.aspx page was invoked because of a timeout as opposed to a user loging in for the first time?