1

Vaadin 7.2 and later offers this static method:
VaadinSession.getAllSessons( javax.servlet.http.HttpSession httpSession )

The doc says:

Retrieves all VaadinSessions which are stored in the given HTTP session

How does a user ever have more than one VaadinSession per HttpSession? Does that happen by an action performed by the user, or by me programmatically in my Vaadin app?

diagram of each HttpSession object having one or more VaadinSession objects of which each has one or more UI objects

Basil Bourque
  • 303,325
  • 100
  • 852
  • 1,154
  • By the way, if you find this Question interesting you may also enjoy this Question, [@PreserveOnRefresh - Purpose and need?](http://stackoverflow.com/q/23612615/642706) and [my much more involved expansion](http://i.stack.imgur.com/ufjIQ.png) of the diagram seen above. – Basil Bourque Jul 19 '15 at 00:51

1 Answers1

3

The VaadinSession is always stored inside a HttpSession.

Multiple Vaadin Apps In Single .war

If the deployment (a WAR file) contains more than one Vaadin applications (servlets), and the user uses those applications simultaneously, then user's HttpSession contains more than one VaadinSession objects.

For example, a war file contains two Vaadin applications (servlet mappings), and the users is using those both in Chrome browser, then the HttpSession for that user contains two VaadinSession objects. If those applications are deployed on separate war files, then there is a HttpSession for both applications and both sessions contains one VaadinSession.

Basil Bourque
  • 303,325
  • 100
  • 852
  • 1,154
Henri Kerola
  • 4,947
  • 1
  • 17
  • 19