I'm trying to implement an automatic timeout inside of an existing PHP application.
My goal is to have the system notify the user 15 seconds before the automatic timeout is set to occur and give them the opportunity to 'reset' the timeout timer.
I'm using jQueryUI bits as a part of all of this.
This chart may help describe what I'm trying to do.
I have a working timer and notification in place. What I'm looking for is the loop of Get prompted for auto logout -> cancel auto logout -> restart timer -> Get prompted for auto logout. (It's what's in red on my chart.)
Are there any good, existing options for me to do this?
Here's what I have so far, but I think I'm stuck...
window.setTimeout(function() {
$('#timeOutNoticeMsg').css('color', '#000000');
$("#timeOutDialog").dialog({
bgiframe: true,
modal: true,
resizable: false,
draggable: false,
buttons: {
"Cancel Logout": function() {
$(this).dialog("close");
window.clearTimeout(timeoutHandle);
}
},
});
}, 103000);
var timeoutHandle = window.setTimeout(function() {
window.location.href = 'logout.php?w=1';
}, 115000);