function warnuser()
{
if (confirm("There has been no activity for some time.\nClick 'OK' if you " +
"wish to continue your session,\nor click 'Cancel' to log out.\nFor your " +
"security if you are unable to respond to this message\nwithin 2 minutes you " +
"will be logged out automatically."))
{
//post the page to itself
document.location.href = "Main.aspx"
}
else
{
document.location.href = "Index.aspx"
}
}
Style 2 is simpler and simply posts a warning:
function SessionAlert()
{
alert("Your Session will time out in 19 minutes");
}
setTimeOut("SessionAlert", 1 * 60 * 1000);
I tried setting the second one for just a minute just to see if it would work. It doesn't. Following is the setting that is deployed on the web.config page in the ASP.net applcation (and it does time out in 20 minutes):
<sessionState mode="InProc" cookieless="false" timeout="20" />
Thanks
SagarP
http://www.emanonsolutions.net
http://emanonsolutions.blogspot.com/
Praveenbandi, if this helps please login to Mark As Answer. | Alert Moderator