dkeene Posted July 6, 2020 Posted July 6, 2020 Hello Is there any way to make the application WARN the user when a timeout will occur? For example, using online banking, no matter what form I am on, if I leave the session unattended it will pop-up a warning and indicate X minutes to forced log off unless you wish to continue, and if not, will close the session and revert to login screen? This would protect your banking information and privacy and prevent user from leaving the system unattended. Thank you! Any example would be helpful Doug Quote
Sherzod Posted July 7, 2020 Posted July 7, 2020 8 hours ago, dkeene said: Is there any way to make the application WARN the user when a timeout will occur? For example, using online banking, no matter what form I am on, if I leave the session unattended it will pop-up a warning and indicate X minutes to forced log off unless you wish to continue, and if not, will close the session and revert to login screen? This would protect your banking information and privacy and prevent user from leaving the system unattended. Hello, You can also analyze this post... Quote
dkeene Posted July 7, 2020 Author Posted July 7, 2020 Thank you, Sherzod for the reference. Are you saying to copy the following text into the form's "SCRIPT" property in the object inspector: var IDLE_TIMEOUT = 60; //seconds var _idleSecondsCounter = 0; document.onclick = function() { _idleSecondsCounter = 0; }; document.onmousemove = function() { _idleSecondsCounter = 0; }; document.onkeypress = function() { _idleSecondsCounter = 0; }; window.setInterval(CheckIdleTime, 1000); function CheckIdleTime() { _idleSecondsCounter++; var oPanel = document.getElementById("SecondsUntilExpire"); if (oPanel) oPanel.innerHTML = (IDLE_TIMEOUT - _idleSecondsCounter) + ""; if (_idleSecondsCounter >= IDLE_TIMEOUT) { //alert("Time expired!"); //document.location.href = "logout.html"; ajaxRequest(MainForm.form, '_idle_timeout', []); } } and then copy the following into the form's OnAjaxEvent: if EventName = '_idle_timeout' then begin // your logic ShowMessage('idle_timeout'); end; this is what I tried but no result. Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.