JSF How to destroy user session on browser close

User is closing the browser instead on clicking on sign of. In this how to destroy user session?
Calling servletRequest.getSession().invalidate(); using javascript or using listener or using both?
skumar99Asked:
Who is Participating?
 
leakim971Connect With a Mentor PluritechnicianCommented:
Use a timer.
The user end if there's no action of the user.

http://techieexchange.wordpress.com/2008/02/21/jsf-session-expired-timeout-solution/
0
 
ElbasselCommented:
- You can make a listner by Javascript when the window is closed
- Make the listner call you JSF code and the JSF code executes: session.invalidate
Best Wishes
0
 
ElbasselCommented:
- You can make a listner by Javascript when the window is closed
- Make the listner call you JSF code and the JSF code executes: session.invalidate
Best Wishes
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.