Session time out notification

113 views Asked by At

My web-application developed on Vaadin - Servlet using Tomcat server.

When user clicks logout link, session timeout error is coming and then after some time it is automatically redirecting to login page.

Previously the redirection was so fast that user was unable to see this timeout error. But now after some version update in Vaadin, user is able to see this error.

Suggest a way to resolve this issue. I am thinking of finding a way to stop the browser from showing the error message for session-timeout , when the session is timed out using logout button.

How to achieve it. Or is there a better solution you can suggest?

Thanks in advance.

1

There are 1 answers

0
Manish Kapasiya On

Before invalidating the session disabling the Push Mode.

Page.getCurrent().setLocation(location);

UI.getCurrent().getPushConfiguration().setPushMode(PushMode.DISABLED);

session.getSession().invalidate();

This will work fine. The problem comes because support for Push is not fully implemented by all servers. So on some servers this problem may not arise.

With above logic you can also set Transport.LONG_POLLING which works fine for all servers.