How to handle "logout" with multiple UIs (browser tabs)?

The user has a browser tab open which shows one View of a UI instance. On that View, there’s a “Logout” button. When the user clicks on it, I invalidate the session and redirect to the login View:

getUI().getSession().getSession().invalidate(); getUI().getPage().setLocation("/reporting/"); This works well. But suppose the user has another UI/View open in a second tab. The next time he tries to interact with that View, he gets an error (since the session is invalid). Instead of showing an error, I’d like to have him directed to the login page. Does anyone know how to best accomplish that?

Any help is much appreciated.


if you have push enabled, you can forward all the UIs in the session to a url you want. You can access the UIs from VaadinSession.getUIs().


Worked like a charm - thanks a bunch!