Session Handling Issue in AKS Cluster Environment

Hi Team,

We are experiencing a problem with user sessions in our application deployed on an AKS cluster. Specifically, when User 1 logs in via Chrome, a session is created. Simultaneously, User 2 logs in through Firefox, establishing a separate session. However, when User 1 makes a request, the response is incorrectly routed to User 2. This issue arises because our current implementation stores session data in the JVM memory, leading to inconsistencies across different pods.

Current Implementation:
We use a Map to associate user IDs with their corresponding session IDs, allowing users to log in from multiple browsers and storing their session information.
When a user logs out, we invalidate all sessions related to that user.
Problem:
In our AKS environment, we cannot predict which pod will handle a user’s login or logout request. As a result, session data may remain in memory on one pod, while another pod may not have access to the latest session information.

Desired Solution:
Is there a way to externalize vaadin session so that when user logs out, it is logout from all instances in an aks cluster

You need session affinity aka sticky sessions.

Read also Distributed Deployment Architecture | Deploying to Production | Flow | Vaadin Docs