ONLINE HELP
 WINDEVWEBDEV AND WINDEV MOBILE

This content has been translated automatically.  Click here  to view the French version.
Help / WLanguage / WLanguage functions / Web-specific functions / Miscellaneous WEBDEV functions
  • Principle
  • Notes
WINDEV
WindowsLinuxUniversal Windows 10 AppJavaReports and QueriesUser code (UMC)
WEBDEV
WindowsLinuxPHPWEBDEV - Browser code
WINDEV Mobile
AndroidAndroid Widget iPhone/iPadIOS WidgetApple WatchMac CatalystUniversal Windows 10 App
Others
Stored procedures
SessionHeartBeatEnable (Function)
In french: SessionHeartBeatActive
Enables or disables the "heartbeat" of the current session.
Remark: By default, the heartbeat of the current session is set to 5 minutes.
Example
SessionHeartBeatEnable(True, 10 min)
Syntax
SessionHeartBeatEnable(<Enabled> [, <Interval>])
<Enabled>: Boolean
  • True to enable the heartbeat,
  • False to disable it.
<Interval>: Optional duration or string
Interval between two calls. This parameter can correspond to:
  • a Duration variable,
  • the duration in a readable format (e.g., 5min).
The default interval is 5 minutes (unless the session timeout is shorter).
Remark: the WEBDEV Application Server has a wait time set to 1 minute, regardless of the interval configured. Therefore, this minute is always added to the interval specified by the parameter.
Remarks

Principle

The purpose of the session heartbeat is to reduce server load by closing sessions earlier (for example, by detecting sessions where the user is offsite).
The HeartBeat feature is an automatic process on the browser that regularly sends information to the server (e.g. every 5 minutes) to indicate that the browser is open. Once the user has closed the browser, the server no longer receives this HeartBeat and can therefore close the session immediately, without waiting for the timeout.
Caution: The HeartBeat does not allow extending the session beyond the idle user timeout (defined in the WEBDEV Application Server). If you set a session timeout to 10 minutes, the session will be closed after 10 minutes without an action from the user, even if the browser is still open.
Therefore, choosing the right interval is essential:
  • If the interval is too big, sessions remain open for too long.
  • If the interval is too short, the server is unnecessarily loaded with heartbeat calls to keep the sessions alive.
Caution: These heartbeat calls consume resources (network and battery) in the case of mobile clients.
The WEBDEV application server tries to dynamically detect whether session maintenance is possible.. Sessions are terminated early only if the application server detects that the Page displayed on the customer's site is a complete Page of the site.. Otherwise (the response is a generated Image, a buffer, or the display of an external Page, e.g. payment), early session termination is disabled, until the next request for the session that returns a complete Page from the site.

Notes

  • The call to SessionHeartBeatEnable is taken into account from the next page returned by the WEBDEV Application Server.
  • If the configuration is to be applied to all pages of a site, SessionHeartBeatEnable must be called in the initialization code of the project, or of the first page (or any code called before the first page is returned).
  • SessionHeartBeatEnable also enables the heartbeat in test mode (project or page test via "Go"). It is usually ignored because the test mode detects the browser is closed and the session is immediately terminated.
Component: wd290page.dll
Minimum version required
  • Version 26
Comments
Click [Add] to post a comment

Last update: 11/14/2023

Send a report | Local help