One session per tab in JSF 1.2

483 Views Asked by At

I am working on a JSF 1.2 application. Consider the following use case with a browser with 2 tabs:

  1. In the first tab I login with user 'TEST'.
  2. In the second tab I login with user 'TEST2'.
  3. When I return back to the first tab, the logged-in user is changed to 'TEST2'.

How can I restrict the login to the current tab instead of all tabs? In other words, how can I restrict the HTTP session to one tab instead of all tabs of the browser instance?

2

There are 2 best solutions below

0
On

Simply use 2 different browsers (like chrome and firefox)

If you're using FireFox install the MultiFox plugin

0
On

Try to use the Private Tab. This will do the trick.

The private tab does not hold cookies. So it's a new session cookie for each tab.

NEW:

Another approach is disabling the cookies for your browser.

  • The default JSF behavior is concatenating the JSESSIONID in the URL. So each tab will have a different JSESSIONID as a URL parameter.