Click here to Skip to main content
15,902,114 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi All,

When i login to a site and keep the home page idle for more than one minute, the page gets automatically refreshed and got logged out.

Can anyone suggest on this.

Thanks in Advance.

Regards,
Bala.
Posted

1 solution

You can use JavaScript setTimeout...

var SpanTime = 0
window.onload = function()
{
     setTimeout(CheckIdle, 1000); // Every second call the method CheckIdle()
}

function CheckIdle()
{
     if(SpanTime <= 60)
          SpanTime++;
     else
          window.location = 'logout.aspx';
}


Hope that help :)
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900