I have created a heartbeat mechanism to keep the user's session alive. It will run every 60 seconds. Question is, why not set this to like 15 minutes? Also, why use a heartbeat at all; can't I just set my session expiration time in IIS?
I just want to make it so if a user leaves the page for a half hour or so and goes and gets lunch, that they can come back and their session will still be there when they click submit, so they won't lose any data they might have entered before they left.
$(function () {
// every 60 seconds...
setInterval(KeepSessionAlive, 60000);
});
function KeepSessionAlive() {
$.post("/FACTS/_code/Heartbeat.ashx", null, function () {
//console.log('Session is alive and kicking');
});
}