Skip to main content
Version: Next

On Web Legacy Close Session database method

On Web Legacy Close Session database method

Does not require any parameters

Compatibility Note

This database method can only be used with legacy web sessions, available in databases converted from versions prior to 4D v18 R6. It is never called when scalable web sessions mode is enabled (recommended in 4D v18 R6 and higher). For more information, please refer to the Web Sessions Management (Legacy) section.

The On Web Legacy Close Session database method is called by the 4D Web server each time a Web session is about to be closed. A session can be closed in the following cases:

  • when the maximum number of simultaneous sessions is reached (100 by default, modifiable using the WEB SET OPTION command), and 4D needs to create new ones (4D automatically kills the process of the oldest inactive session),
  • when the maximum period of inactivity for the session process is reached (480 minutes by default, modifiable using the WEB SET OPTION command),
  • when the WEB LEGACY CLOSE SESSION command is called.

When this database method is called, the context of the session (variables and selections generated by the user) is still valid. This means that you can save data related to the session in order to be able to use them again subsequently, more specifically using the QR SET DESTINATION.

Note: In the context of a 4D Mobile session (which can generate several processes), the On Web Legacy Close Session database method is called for each Web process that is closed, allowing you to save all types of data (variables, selection, etc.) generated by the 4D Mobile session process.

An example of the On Web Legacy Close Session database method is provided in the Web Sessions Management (Legacy) section.

See also

WEB LEGACY CLOSE SESSION
Web Sessions Management (Legacy)