I have a pretty strange problem: I have a web app that is based on Vaadin. When one user logs in and makes some actions, it goes all fine. When the second user logs in, the first user starts to use the session and the context from the second user… I have such kind of context loading:
private Context getContextFromSession() {
WebApplicationContext context = (WebApplicationContext) this.getContext();
Context c = (Context) context.getHttpSession().getAttribute("context");
if (c == null) {
c = new Context();
context.getHttpSession().setAttribute("context", c);
}
System.out.println("Current session: " + context.getHttpSession().toString() + " , context: " + c.toString());
return c;
}
Does Vaadin actually support multisessions?
Yes, Vaadin supports multiple concurrent users.
However – as with most web applications/java application server combinations – you can only have one HTTP session open in a browser instance at a time. For example, you can’t have two separate tabs in one browser instance, one for User A and one for User B.
It’s a bit more complicated than that, but this is good place to start. Are you using the same browser instance, or is it two separate “client” machines/processes?