Hi,
Is there a script I can use to regularly refresh a form thus avoiding a session timeout?
I found http://www.webdevbros.net/2006/12/14/ke ... avascript/ while googling and have tried adding the script to the ready event of the page under HTML properties but I can't get it to work.
Regards,
Edd
Script to avoid session timeout
Moderators: Jon, Steve, Ian, Dave
-
- Ebase User
- Posts: 53
- Joined: Wed Jan 02, 2013 4:23 pm
- Location: Lyndhurst, Hampshire
- Contact:
- dvanhussel
- Ebase User
- Posts: 161
- Joined: Fri Oct 19, 2007 12:45 pm
- Location: Haarlem, the Netherlands
Hi,
Ik think the problem with this script is that in the 'refresh', there is no interaction with the Ebaseserver, so it's session is not updated.
Maybe you can call a dummy ebase function, or update a dummy field value. Then the server 'knows' that the form is still being used.
Something like this (not tested!):
In the form you set 'Client accessibility' property of the DUMMY_FIELD to 'Read/write'.
Regards,
David
Ik think the problem with this script is that in the 'refresh', there is no interaction with the Ebaseserver, so it's session is not updated.
Maybe you can call a dummy ebase function, or update a dummy field value. Then the server 'knows' that the form is still being used.
Something like this (not tested!):
Code: Select all
function keepMeAlive() {
var date = new Date();
$eb.setFieldValue('DUMMY_FIELD', date, false);
}
window.setInterval(keepMeAlive, 100000);
Regards,
David
Last edited by dvanhussel on Tue Aug 11, 2015 9:00 am, edited 2 times in total.
0 x
-
- Ebase User
- Posts: 331
- Joined: Mon Mar 10, 2014 8:34 am
Hi Edd,
I have a button in a form that is hidden by JQuery, this has a script to simply log a statement (ie interact with the server). Then within the form html++ the following simply clicks the button every 10 minutes to keep the form alive.
I have a button in a form that is hidden by JQuery, this has a script to simply log a statement (ie interact with the server). Then within the form html++ the following simply clicks the button every 10 minutes to keep the form alive.
Code: Select all
<script>
$(document).ready(function() {
setTimeout(RunEvent,60000);
});
function RunEvent() {
setTimeout(RunEvent,600000);
$("#TriggerButton").trigger('click');
}
</script>
0 x
-
- Ebase User
- Posts: 53
- Joined: Wed Jan 02, 2013 4:23 pm
- Location: Lyndhurst, Hampshire
- Contact:
Who is online
Users browsing this forum: No registered users and 15 guests