In a specific scenario, we face the need to manage multiple sessions similar to Google Accounts. Users should be able to add different accounts in separate tabs, each with its own unique content. For example, user1 may be logged in on Tab1 while user2 is logged in on Tab2.
Our frontend is built using Angular and our backend is JAVA.
We're considering utilizing local storage in the frontend to store an array of users. The current user will then be passed in the URL. For instance, in Tab1 the URL would be http://localhost:8080/account/user1/, and in Tab2 it would be http://localhost:8080/account/user2/
The issue arises when dealing with HttpSession, as it would differ in each case. Attributes are set in the HttpSession within the code. It's my understanding that the ServletContainer manages sessions separately, identifiable by sessionId. The challenge lies in passing the sessionId in the request to Java so that the server code can access the appropriate session. For example, if tab1 is open, the session related to user1 should be selected, and if tab2 is open, the session tied to user2 should be accessed.