TroubleShooter Posted July 9, 2018 Report Share Posted July 9, 2018 Hi, Was hoping someone can help me here. I know that the DataPage timeout is a security feature of Caspio to prevent unauthorized access of other people when the user is AFK. However, I would want my users to be notified if they will be logged out after a couple of minutes for them to save their work. A support person suggested that I extend my login timeout in the Authentications. But I don't use one. Finally, he/she told me that it is possible to notify my users that they will be timed-out with the use of JavaScript. Quote Link to comment Share on other sites More sharing options...
DefinitelyNot31337 Posted July 16, 2018 Report Share Posted July 16, 2018 Hello @TroubleShooter, You may try to add this snippet of JavaScript Code in the footer (source) of your DataPage. Just read through the inline comments (//). Works for me in all DataPages where you can insert a Footer. <script> // Edit the values here to your liking var message = 'You will be logged out after [x] minutes. Please save your work to prevent input loss.'; var hour = 0; var min = 0; var sec = 3; // It is not necessary to edit things beyond this point //Do not edit the Hour, Min, Sec here. They are used as a Default Value! setTimeout(function(hour=0, min=0, sec=1) { //Do stuff here //Get Time Reference var timeRef = new Date().toLocaleTimeString('en-US'); //Show the timeRef and the Message alert('[' + timeRef + '] ' + message); //You can also do other stuff below such as (displaying a div, auto-press the save button, etc...) }, (hour*1000*60*60 + min*1000*60 + sec*1000) ); </script> Disclaimer: Use these JavaScript solutions at your own risk! They are provided to assist you in the customization of your programs and while we believe they work properly, by using them you accept all responsibility about them and confirm that they are not a feature of Caspio's platforms and as such are provided "as is" without any warranties, support or guarantees. Amyas 1 Quote Link to comment Share on other sites More sharing options...
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.
Note: Your post will require moderator approval before it will be visible.