Reset JSF session and the managed beans with sesison scope

Hi,

this is a very general question and maybe stupid for most of you. I have my jsf/facelets web application and i use inside of this application some managed beans, which are session beans. I want to know how is it possible to reset this beans. I'm asking this question beacuse i have this kind of problem: i built my web application which has a login form and i use the browser to test it. When i browse to the login page and I login with my credentials i get my customized home page. Then i open another istance of the browser and i browse to the login page again but this time i login as a different user. The result home page is the same as i got before with my login credentials, so the session is always the same. Instead i want the session and all its objects to be resetted for the new user! Do youn know which is the solution?

[851 byte] By [kurtu2a] at [2007-11-27 10:04:33]
# 1
We had a similar problem in our project. Our solution was to iterate over the session map and remove the targeted beans from the map. If you do not have any beans you need to keep or desire a completely new session, you could use HttpSession.invalidate().
RaymondDeCampoa at 2007-7-13 0:39:40 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...
# 2

The fact is that i want to have two sessions in parallel, so using the same browser and opening two tabs, i want to browse to the login page and access as two totaly different users and using in parallel the application without the problem of one user's action affecting the other user beacuse of session sharing. So I want to force the application to create two different session for the two users logins, because as i told you before as it is now, they are sharing the same sesison. And i think that if i at the login time I iterate thorugh the session and delete all the objects i will be able to have only one session per time. Isn't it?

kurtu2a at 2007-7-13 0:39:40 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...
# 3

Pretty much. If you are tracking the session by cookies your only choice is to have one session per browser (although someone may have created a Firefox plug-in to get around this). Unless this is a use-case for production I wouldn't bother writing any code to get around it. For development either use two different browsers or create a separate profile on a browser that supports it (e.g. Firefox).

RaymondDeCampoa at 2007-7-13 0:39:40 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...