In my Java EE application, I have a problem with sessions. Different users can enter the application, and the specified user can see the data for which he is authorized. It should not see other user data. To distinguish between users, we use Client_ID . As soon as the user logs in, we will extract this Client_ID from the database and set it in the session as follows:
session.setAttribute("Client_ID",user.getClient_ID())
We access this session value throughout the application and retrieve the appropriate data for this Client_ID . This works great when users are running in the same browser, but the problem is this:
Suppose there is a SuperAdmin that needs to look for all the clients under it. SuperAdmin registers as client_1 and again as client_2 . SuperAdmin logged in both times using the same browser. When I update the client_1 browser, I see client_2 details that should not be.
I think our application uses the same session for two different logins in the same browser. What will be the solution to this problem? When I refresh the page, I should see the correct data for a particular client.
Mahesh
source share