| Author: Siddesh Kapadi 05 Jul 2008 | Member Level: Silver | Rating: Points: 3 |
You can use the authenticated settings in web.config file. This can be done using the FormsAuthentication as well. Try some code using forms authentication can check for the method is IsAuthenticated. This will give you the expected output.
|
| Author: sandeep 07 Jul 2008 | Member Level: Gold | Rating: Points: 5 |
put this code on aspx page....... <script type="text/javascript" language="JavaScript"> window.onload=WindowLoad; function WindowLoad(event) { setTimeout("location = 'Default.aspx';", 120000); } </script>
put this code on .cs file......... protected void Page_Load(object sender, EventArgs e) { Session.Clear(); Session.Abandon(); FormsAuthentication.SignOut(); }
|
| Author: Jessie 07 Jul 2008 | Member Level: Gold | Rating: Points: 6 |
Using Window.setTimeout method
body.Attributes.Add("onLoad", "window.setTimeout(""window.location.href='login.aspx'""," & (Session.Timeout * 60 * 1000) + 10000 & ");")
Using Meta Tag - Refresh
Response.AppendHeader("Refresh", Convert.ToString((Session.Timeout * 60) + 10) & "; url="Login".aspx")
Both these methods will redirect the user to login page after session timeout + 10 seconds. This is how you can redirect the user to login page after session timeout without user interaction.
|