Docs

Documentation versions (currently viewingVaadin 14)

You are viewing documentation for an older Vaadin version. View latest documentation

Using sessions with MPR

The state of the in an MPR project is managed by the com.vaadin.flow.server.VaadinSession class, but the methods from the legacy com.vaadin.server.VaadinSession class can also be used, since both wrap the same javax.servlet.http.HttpSession.

Invalidating a session

To invalidate a session (and possibly start a new one), you can invalidate the session managed by Flow and reload the page.

For example:

Button close = new Button("Close session", event -> {
    VaadinSession.getCurrent().getSession().invalidate();
    UI.getCurrent().getPage().reload();
});

B5906CBE-F351-4687-8E35-A18680E18EA1