How to restart Vaadin session?

流过昼夜 提交于 2019-12-08 06:24:02

问题


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.


回答1:


In my project I use this:

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


来源:https://stackoverflow.com/questions/26404821/how-to-restart-vaadin-session

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!