Skip to main content
Version: 4

Enabling Sticky Sessions for the Portal in HA Mode

In a SAML-enabled environment running in High Availability (HA) mode—where multiple replicas of the Portal service are deployed behind a load balancer (such as a Kubernetes Service or an ingress controller)—it becomes essential to maintain Session Affinity, commonly known as Sticky Sessions. This ensures that once a session is established after SAML authentication, all subsequent requests from the user are routed to the same Portal instance.

Why Sticky Sessions are needed​

Without Sticky Sessions, requests from the same user may be handled by different Portal pods, potentially resulting in:

  • Loss of session context (for example, user authentication state)

  • Intermittent logout or reauthentication issues

  • Inconsistent behavior during user interactions

Enabling Sticky Sessions prevents these issues by maintaining a stable connection between the client and a specific pod.

Configuring Sticky Sessions​

To configure Sticky Sessions for a SAML-enabled environment running in High Availability (HA) mode—where multiple replicas of the Portal service are deployed behind a load balancer (Ingress Controller), you need to configure:

  1. Cookie-based Session Affinity at the ingress level

  2. Client IP-based Session Affinity in the portal service

Configuring Sticky Sessions at Ingress level​

Enabling Session Affinity at the Ingress level ensures stickiness even when the client's IP changes or is masked (for example, by a proxy).

To enable Session Affinity at the Ingress level, follow the steps below:

  1. Run the following command to open the ingress rules in edit mode. 

  2. In the ingress rules, add or update the following annotations:

  3. Save the file.

  4. Restart the Ingress Controller to apply the changes.

Configuring Sticky Sessions in the portal service​

To configure Sticky Session in the portal service, follow the steps below:

  1. Open the global values.yaml file.

  2. Go to the portal > sessionAffinity block.

  3. Remove the empty curly braces (representing no configurations for Session Affinity)

  4. Add the following Session Affinity configurations:

  5. Restart the Portal and Webapp Gateway microservices.