Skip to main content
OutSystems

How to change the timeout of a session

Question

How to change the session timeout?

Answer

The session timeout is the period of time that a session can remain idle, without any end-user interaction, before the Platform Server ends the session automatically. OutSystems uses the .NET or J2EE session mechanisms to manage its sessions.

To change the session timeout for a set of eSpaces, you must add a custom configuration at the level of the application server (.NET only). This custom configuration can also be added in OutSystems cloud-hosted environments. Please follow these steps:

  1. Install Factory Configuration from the Forge;
  2. Add a Shared configuration with the following details:
    • Kind: web.config_XSL
    • Value (where the timeout attribute specifies the timeout in minutes):
      <?xml version="1.0" encoding="UTF-8"?>
      <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
          <xsl:output method="xml" indent="yes" encoding="UTF-8"/>
          <xsl:template match="@*|node()">
              <xsl:copy>
                  <xsl:apply-templates select="@*|node()"/>
              </xsl:copy>
          </xsl:template>
      
          <xsl:template match="/configuration/system.web/sessionState">
              <xsl:copy>
                  <xsl:attribute name="timeout">60</xsl:attribute>
                  <xsl:apply-templates select="@*|node()"/>
              </xsl:copy>
          </xsl:template>
      </xsl:stylesheet>
      
  1. Associate the shared configuration with the desired eSpaces;
  2. Republish the eSpaces to generate web.config files updated with the new timeout value.

Advanced session customization

If you need to further customize your session-specific flow, you can use custom callbacks that are called in the beginning of each session and implement your own logic. To add these callbacks in your logic, please refer to the screenshot below:

unnamed.png

  • Was this article helpful?