Problem: New Vaadin Aplication instance created on every browser refresh

Hi,

I just noted the following problem: after I hit Refresh button/Ctrl-R in Chrome or Opera, a new http session and a new Vaadin application instance are created.
In my opinion it is incorrect behavior.
In Firefox everything looks normal - after forcing browser refresh the current HttpSession and Vaadin application instances are preserved and reused.

My setup is as follows:
Vaadin 6.7.9
Spring 3.1.0.RELEASE
Google Chrome 18.0.1025.142
Opera 11.00
Mozilla Firefox 3.6.23

Is it a bug or I am doing something completely wrong?
Please advise.

Thank you in advance!

In Firefox refresh on a single tab creates a new session, multiple tabs use the same session.
In IE8 each tab has it’s own session, because their trick was to use one explorer instance for each tab, or something like that
Don’t know about the rest

Hi,
I think this is even more strange and can be related to Chrome.

If I use the following URL http://localhost:8080/myApp/ everything is fine - all the requests reach the same Vaadin application.

If I use the following URL http://localhost:8080/myApp (
please note the lack of last slash /!
) then with each invocation (page refresh) we’ll get new application.

This is because Chrome gets JSESSIONID every time we refresh using the second approach, and so the session is different. In com.vaadin.terminal.gwt.server.AbstractApplicationServlet.getExistingApplication(HttpServletRequest, boolean) line 2245 , where final HttpSession session = request.getSession(allowSessionCreation); is called, this finds new session every time, thus can’t retrieve existing application for it.

Unfortunately I have no idea who’s responsible for what - I’m too fresh in web development…

It’s important to say, that the described behaviour doesn’t occur with Firefox!

Piotr

This looks suspiciously much like the same issue as
https://vaadin.com/forum/-/message_boards/view_message/1230574#_19_message_1229649
, though I’m not entirely sure why it’s not happening in Firefox. You should however first try changing the sessionCookiePathUsesTrailingSlash setting if you’re using Tomcat.