ASNA Browser Terminal™ Reference Manual

Session Timeouts

This topic describes Session Timeouts, why they occur, how ASNA Browser Terminal handles them, and how developers can customize how they're handled.

When a BTerm accesses the IBM i, it starts a session like any 5250 terminal, however since BTerm runs in a web browser instead of a standard terminal session, it is possible to close the browser or navigate to another page without properly ending the session and any jobs attached to it. This may lead to system resources being tied up or files being locked to the user of the abandoned session.

Warning – There is no built-in visual cue that a session timeout has occurred. This means that a timed-out user can still fill in fields, but may not be aware that their session has ended until they attempt to submit information.

By default BTerm pages use the ASP.NET standard of timing out after 20 minutes of inactivity. Inactivity, in this case, refers strictly to information being passed to the server; only clicking the submit button or otherwise sending messages to the IBM i will reset the timer, mouseclicks and information entered into fields will not. The preferred method of changing this setting is through the Microsoft Internet Information Services (IIS) Manager GUI. In Windows 7, open the Start menu – IIS Manager – Session State then locate the Time-out (minutes) field under Cookie Settings, then click Apply on the right. Whatever number you set will be passed as a parameter of the sessionState Timeout method in the web.config.

Note – In order to access this GUI, you muse have the IIS Manager, as well as its .NET Extensibility and ASP.NET components, installed and active. In Windows 7, you can add all the required components through the Turn Windows Features on or off dialog.

The sessionState Timout method can also be applied in the web.config file.

In the web.config file, the sessionState.timeout method can be set inside the <system.web> tag, as shown below.

<configuration>
  <system.web>
    <sessionState 
      mode="InProc"
      cookieless="true"
      timeout="30" />
  </system.web>
</configuration>

Once the Timeout method is triggered, it will call Session_end, which will trigger code to prepare the application for shutdown (eventually closing the DataGate connection). The default parameter passed is set to 20 which tells the Job.Request process to wait up to 20 seconds for the application to finish cleanup.

Sessions can also be terminated immediately by guiding the Browser Terminal to the EoJ.aspx script, which calls the abandon method and displays Monarch/!ExpiredSession.html. Developers can modify this (static HTML) file to customize its appearance and the message it displays.