XStandard Developer's Guide: Advanced Topics: Heartbeat

The XHTML WYSIWYG Editor For Desktop & Web Applications

Heartbeat

Web-based content management systems log out users (i.e. lose Session state) after a period of inactivity between the browser and the Web server. Even if a browser is open and a user is authoring content, in Web terms this is considered inactivity. When Session state is lost, users are forcibly logged out and valuable work is often lost. To avoid this, XStandard Pro has a feature called "Heartbeat" which can send HTTP pulses to the server at regular intervals. The continuing stream of pulses tells the Web server that the user is still connected and that Session state should not be lost. This ensures authors remain logged into the content management system for as long as they need to complete their work.

Heartbeat

To enable the heartbeat, create a Web page in the same development environment that your CMS is written in (ASP, PHP, etc.) and put the Web page in the same folder with the rest of your CMS Web pages. Add a line of code to the Web page in order to trigger the scripting engine. This can be as simple as writing out the current date. Here is an ASP example:

  1. <%
  2. Response.Write Now()
  3. %>

Then, in the <object> tag for the editor, add the following <param> tag and point it to the location of the newly created Web page:

  1. <param name="HeartbeatURL" value="http://myserver/heartbeat.asp" />

To set the length of the pulse interval, use the following <param> tag where the value is measured in seconds:

  1. <param name="HeartbeatInterval" value="300" />