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

# Using Sessions with MPR

The state of the UI in an MPR project is managed by the `com.vaadin.flow.server.VaadinSession` class. However, the methods from the legacy `com.vaadin.server.VaadinSession` class can also be used, since both wrap the same `jakarta.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.

Below is an example of this:

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

[\<Back to Overview](https://vaadin.com/docs/next/tools/mpr/overview.md)

`4AACE081-AFEE-4522-A491-4EC6FC4C9C05`
