This function prevents a Profound UI Rich Display File session or a Profound UI Genie session from timing out. This is done by sending a keep-alive AJAX request to the server. The standard session timeout is defined using the PersistentCGITimeout directive in the HTTP configuration file. The pui.keepAlive() function will NOT be in effect if the Client Side Timeout flag is true. To use the pui.keepAlive() function, you must set client side timeout monitoring to false.
Example:
The following example keeps track of mouse movements in order to keep the session alive. Even though the user may not have submitted any screens to the server; if they have been active with their mouse in the browser, the session will not time out.
var lastMouseMovement = new Date().getTime(); function checkKeepAlive() { var elapsedTime = (new Date().getTime()) - lastMouseMovement; if (elapsedTime < 600000) { // if time since the last mouse movement is less than 10 minutes // send keep-alive request to keep the session from timing out pui.keepAlive(); } } setInterval(checkKeepAlive, 600000); // call checkKeepAlive every 600,000 ms (10 minutes) // Keep track of the last time the mouse has moved within the browser window addEvent(window, "mousemove", function() { lastMouseMovement = new Date().getTime(); });