B4J Question [ABMaterial] Different Users has same session!

Mr_fifty4

Member
Licensed User
Longtime User
After a long time, I went back to using this framework for a small app. I started with the mini template version 5.15, adding what I needed. I enabled login with the "server.NeedsAuthorization" property, managing about ten users with different passwords. Everything works but if one user is already logged in, the second user is not asked to login and enters the first user's session. I'm probably doing something wrong but I don't know what to check. Each user probably needs to open a different session but I don't know how to do that.
thanks.
 

Mr_fifty4

Member
Licensed User
Longtime User
I think I found the problem: when a user (1) logs, in sub "CheckLogin" I check the user and set attribute properties (different for each user). These properties are used in various web pages to index the data to be displayed. When a second user (2) logs the properties are changed for user (2) but if the user (1) presses F5 to refresh his web page he takes the properties of the user (2) (with F5 login page are not displayed).
I tried using "session.setattribute" and "sessiongetattribute" but I don't know where to place the code correctly.

Is there any solution (or best practice) to manage this cases?
thanks
 
Upvote 0

MichalK73

Well-Known Member
Licensed User
Longtime User
After a long time, I went back to using this framework for a small app. I started with the mini template version 5.15, adding what I needed. I enabled login with the "server.NeedsAuthorization" property, managing about ten users with different passwords. Everything works but if one user is already logged in, the second user is not asked to login and enters the first user's session. I'm probably doing something wrong but I don't know what to check. Each user probably needs to open a different session but I don't know how to do that.
thanks.
Are you doing this on one browser in different tabs? If so, that's why it's happening, because the session cookie is assigned to the domain and not to the tab. Check if you have this problem on 2-3 different browsers.
 
Upvote 0
Top