Multiple users see same page?

I’m sure this question has been asked before, and I’m probably doing something obviously stupid, but here it is: My Vaadin application works fine for a single user. But if there are multiple simultaneous users, there are apparently problems. If I open two browser windows on the same client machine, log in with one, and then point the other at the server running the Vaadin application, it opens to the same place as the first one, rather than showing the log-in screen. I have to admit I haven’t carefully examined the effects of trying simultaneous access from two separate client machines, but it seems that there are problems in this scenario also. I am running the Vaadin application with Tomcat on Linux.

Thanks,

Matthew Fleming

If you are using different windows in the same browser on the same computer, the browser windows share the session. Note that you need to implement some window related logic to properly support multiple, separate browser tabs or windows - look for this on the forum, or in any of the application framework add-ons in the directory.

If you see this across different browsers on the same computer (e.g. Firefox and Chrome), or different computers, you probably have some state information in a static variable, or an incorrect implementation of the ThreadLocal pattern which can result in application instances being “mixed up”.

Also, check private variable in a servlet – there is normally only one instance of a servlet, and it’s the “service” method that gets invoked repeatedly, in different threads.

As a related tip&trick, instead of using two different browser applications, you can use the various “private browsing” modes of the modern browsers to create two unrelated browser sessions with the same application.