Hink
Hink

Reputation: 1103

How to restart Vaadin session?

After logout I need to invalidate session and start a new immediately. I used the function

VaadinSession.getCurrent().getSession().invalidate();

After several seconds a red box "Session expired" appears. User must click on it or press F5. How to avoid it and to display new session page immediately?

In javascript is it easy:

document.location='/';

How to do the same in Vaadin? The behavior should be the same as by first visit the page after restarting explorer.

Upvotes: 1

Views: 2327

Answers (1)

Krayo
Krayo

Reputation: 2510

In my project I use this:

Page.getCurrent().setLocation( "/" );
VaadinSession.getCurrent().close();

Upvotes: 5

Related Questions