USER_AGENT

The USER_AGENT element sets a timeout to handle the user agent session.

Syntax

<USER_AGENT>seconds</USER_AGENT>
  1. seconds specifies the number of seconds to wait for a client request.

Child elements

There are no child elements.

Usage

Set this timeout to specify a number of seconds that the GAS is to wait for a client request before assuming that the front-end has died or that there has been a network failure.

Important: The USER_AGENT is managed by the session. A session is started with the first application. If the first application starts several child applications, these applications become part of the session. The USER_AGENT does not time out while any one of these applications have activity.

To keep the application alive in case of user inactivity, the front-end regularly sends a ping request to the GAS.

When does a session time out?

A session times out when the client has not sent a request to the GAS before the USER_AGENT timeout expires. When this occurs, the GAS assumes that the front-end client has died and sends an instruction to close the socket to the DVM, which causes the DVM to shut down.

The USER_AGENT timeout proves to be particularly useful with the Genero web client. As with the other front-ends, when a user properly exits an application, the DVM handling that application is properly shut down.

When does a session not time out?

A session does not time out when the user does not properly exit the application. This can occur when a user closes the browser instead of properly exiting the application. In this case the front-end client has no mechanism to indicate to the GAS that the user has closed the browser. When this occurs the DVM remains alive even though the front-end has died.

For example, if a child application in the session is closed, the front-end sends a closing instruction but that may in some circumstances, such as closing the browser tab, not reach the GAS and the child application keeps on running on your server.

We recommend that you properly exit applications using the application close actions. Otherwise, you may have DVMs running until the main application is exited or has reached the USER_AGENT time out.

Usage example

<USER_AGENT>300</USER_AGENT>

In this example, the USER_AGENT timeout is set to 300 seconds.

Parent elements

This element is a child of one of the following elements: