How to cancel a browser session in JSF

Can someone help me in canceling the session when the user closes the browser. Whenever the user closes the browser, the session should be automatically invalidated in JSF.

Thanks.

+4
source share
2 answers

The links below may help.

Hint: I don’t know this will work, but make an ajax call in the event captured to close the browser, and canceling the session in JSF may do the trick for you.

+2
source

When the browser restarts, the sessionId request of the FacesContext request (JSESSIONID cookie) is automatically launched. Therefore, when you restart the browser check with the old value, make sure that the same sessionId works. This is one solution.

+1
source

Source: https://habr.com/ru/post/1399721/


All Articles