Closing Safari causes vaadin application logout in IOS

I have a login screen where I enter username and password. When I close the browser it logs me out from the application, any idea.

That is exactly how it works and is an intended behaviourā€¦!

When you open an url to Vaadin App it creates a new Http Session and hence a vaadin session and this gets expired in any of the following situtations

  1. Hearbeat requests are not sent to the server in the stipulated time(default 5 mins)
  2. Http Session gets expired due to inactivity after certain amount of time
  3. Calling Session invalidate explicitly

In your case, I believe this is due to
Point 1

Hope this helps.



But it doesnt take 5 minutes. As soon as I close the safari browser, and opens it again, it has already logged me out.

But in chrome it works as required, no application log out when browser closed.

Any idea?

Hello Mark,

As I have said earlier this is working as intended. For that you need to understand on how Sessions are managed. I will explain to you with an example -

You open your web browser and send a request to the server, the server associates & identifies you with an unique code in a Cookie(most of the times it would be JSESSIONID) with id XXXXX1, for every next request the browser makes sure that it sends this cookie as part of its request payload. Once you close the browser & open again the browser is not aware of your older sessionID & when the request goes to the server, the server assigns a new cookie say with ID XXXX10 so you have new session!!

Coming to older session with ID XXXXX1 will be closed after sometime, ideally when any of the params mentioned in my previous post are met.

Hope this helps you!

BTW, this happens on any browser not only on Safariā€¦!