I am decide to redirect to login page when website is open and idle for 2 mins,i have 5 to 6 web pages,after login to website it goes to main page,if user not work or it doesn't use for 2 mins when again user click any link or menus one confirm message is appear and redirect to login page and clear all sessions.
Note: May be use time limit in web.config file
Below code is work when i click page,i want without click it automatically pop up the alert message when page is idle for 2 mins
<html xmlns="http://www.w3.org/1999/xhtml"><head runat="server"><title>Untitled Page</title><script> var logoutUser = false; var timeoutHnd = null; var logouTimeInterval = 20000;// 2 mins function onuser_activite(){ if(logoutUser){ alert("You Session Expired"); window.location.href = "Logout.aspx"; } else{ ResetLogOutTimer(); } } function OnTimeoutReached(){ logoutUser = true; } function ResetLogOutTimer(){ clearTimeout(timeoutHnd); // set new timer timeoutHnd = setTimeout('OnTimeoutReached();',logouTimeInterval); }</script></head><body><form id="form1" runat="server"><div><asp:TextBox ID="tbxarea" runat="server" title="Write your name here"></asp:TextBox></div></form><script>document.body.onclick = onuser_activite; timeoutHnd = setTimeout('OnTimeoutReached();',logouTimeInterval);</script></body></html>Pls reply me asap...
Thans
Aravind