Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

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.

...

Code Block
javascript
javascript

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();
});

...