> Markdown version of [Using sessions with MPR](https://vaadin.com/docs/v10/mpr/configuration/session). Section index: [llms.txt](https://vaadin.com/docs/v10/mpr/llms.txt)

# Using sessions with MPR

The state of the session 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`.

## <a id="invalidating-a-session"></a>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:

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

[← Go back to the overview](https://vaadin.com/docs/v10/mpr/overview.md)
