Redirect after app closes not haapen if session expires.


i have a problem, when i end application user way ( logout, getApplication().close()) everything goes fine and browser is redirected to logoutURL.

But if application is closed after session expire, close() is called, but no redirection happens. Page stays the same and waits for first user input to show “Session Expired” message…

Is this correct behaviour? or How can i make application to be redirected to logoutURL when session expires?

Yes, it is the correct behavior. To forward to an url when the session expires you should override getSystemMessages in Application like so:

public static SystemMessages getSystemMessages() {
        CustomizedSystemMessages csm = new CustomizedSystemMessages();
        return csm;

I was invoke session invalidate() function in my vaadin application. like following,

public void trigerLogoutEvents(MenuItem selectedItem) {
if (selectedItem.getText().contentEquals(“Logout”)) {

and i also override close() method in my “MainForm” java class. like folowing

public void close() {


when i clicked the “Logout” button , it was not happen properly and also show session expired message.

but i want to redirect login page when i was clicked the “Logout” button.

How can I resolve these kind of scenario? Please help me…

But as your session is expired, You no longer have an Application object associated and hence no event trigger will actually work.

This is quite general scenario/functionality that should be supported by Vaadin:

if, because of no activity, user session has timed out, url should be automatically redirected to a logout page. (i mean screen should not stay as is).

has any one implemented this? would it need some kind of push support (which is currently not there)? what i can think of is to have a progress bar (may be hidden), and upon completion of said time, fire the logout related event, (or redirect to logout url). Any suggestions?