When using Forms authentication is there a way to redirect the user back to the login page if they are inactive for a given period of time.
Posted on 2004-11-11
I have an application that uses forms authentication to Authenticate against the Active Directory. If there is no activity for 30 minutes or more and the user then tries to do anything, navigate to a different page, click the submit button etc. I want them to be redirected back to the login page.
In the Web.config file I have the following entries:
<forms loginUrl="logon.aspx" name="adAuthCookie" timeout="30" path="/"></forms>
sqlConnectionString="data source=127.0.0.1;user id=sa;password="
What happens when the use tries to navigate to a new page after 30 minutes is the session has expired so when the code on the page they are navigating to looks for a session variable it throws an error. I want them to be sent back to the login page where they can login again, the session variables will be reset and they will then get redirected to the page they want.