tags:

views:

133

answers:

1

Hi,

I have a web application with a backing bean which has the context of the current logged in user. It is implemented on JSF.

When the user logs out he is forwarded to a login screen (in another JSP page). I would like the current session to be erased when that happens and a new one to be created the next time the user logs in and enters the application.

My question is - how do you delete a session? (I guess the new session will be created automatically the next time the user enters the link)

This is kinda newb i guess, but I couldn't find a solution for this. Thanks for the Help!

+3  A: 
((HttpSession) FacesContext.getCurrentInstance()
   .getExternalContext().getSession(false)).invalidate();
Bozho
And the next time I login the session will be created again?
Ben
yes, it will. try it, just in case.
Bozho

related questions