Click to See Complete Forum and Search --> : Alerting Before Idle Timeout
ejrhodes
05-06-2003, 04:15 PM
In our ASP pages we have a session timeout of 60 minutes. Is it possible to load a javascript timeout on page load that will alert the user with a popup box that 60 minutes of idle time is about to expire and if they hit okay, it will reset the timer?
AdamGundry
05-06-2003, 04:19 PM
Something like the following?
<script type="text/javascript">
function WarnIdle(){
if (confirm('Idle time approaching 60 mins - press OK to reset.') == 1){
window.location.reload();
}
}
setTimeout("WarnIdle()", 60000);
</script>
Adam
ejrhodes
05-06-2003, 04:24 PM
Originally posted by AdamGundry
Something like the following?
<script type="text/javascript">
function WarnIdle(){
if (confirm('Idle time approaching 60 mins - press OK to reset.') == 1){
window.location.reload();
}
}
setTimeout("WarnIdle()", 60000);
</script>
Adam
That looks like it will work. Is it possible to reset the timout without reloading the window because the system this is for is a timecard system. I would hate for someone to be in the process of typing in information, leave for lunch, the idle alarm prompts them, and they hit okay and it refreshes their page causing them to lose their information. That said if that is the only way, this will work. 60000, is that in seconds? Thanks a lot by the way.
lastly, is there a time set on how much time they have before the confirmation will assume they are away and redirect them out?