User session

A user session is like a place that Java web applications use to store data about each user. Each time a user access the application, a new session object is assigned to it. That means that each user has its own session. A session allows us to identify a user. It is a temporal storage where we (and Vaadin) can put data relevant to a user.

Note

Because sessions are temporal, we can configure their lifetime (or timeout) in web.xml:

<web-app ...>
   ...
  <session-config>
    <session-timeout>20</session-timeout>
  </session-config>
</web-app>

Note

Here, each session will last 20 minutes since the last time the user requested something to the server.

Vaadin automatically preserves the state of UI components (if @preserveOnRefresh is present) by storing ...

Get Vaadin 7 UI Design By Example Beginner's Guide now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.