Timeout to logout with reset loop

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.][1] 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); [1]: http://reljac.com/so_1/timeout.png
Won't this log the user out even if they are active on the page?

以上就是Timeout to logout with reset loop的详细内容,更多请关注web前端其它相关文章!

赞(0) 打赏
未经允许不得转载:web前端首页 » jQuery 答疑

评论 抢沙发

  • 昵称 (必填)
  • 邮箱 (必填)
  • 网址

前端开发相关广告投放 更专业 更精准