Is Web2 Session management broken?

Documentation states on the Closing event of the WebSession:

Well, this is NOT true. As Rick pointed out here: Web 2.0 App development, lifecycle and session management

At every refresh (or at every “via Back or re-entering the URL”) a new session id is generated, so is this a Documentation Bug and Xojo cant restore a session? or a Sofware Bug that should be fixed to allow the session to be restored?

And we are not talking about restoring all the GUI, just the same session Id (And its properties, like user loged in or the users items in a shopping cart even if not in, etc.) even if the user is redirected to a home page and the GUI rebuilt.

@Ricardo_Cruz

Have you tried 2022r2 or r3, as it appears to be fixed there.

Im using 2022r2

You are right. I just tested both and it is not working.

Yes, I definitely didn’t express that correctly. Since 2022r2, the browser will continue with its session in cases where the connection to the server has been interrupted temporary. As soon as the browser can connect again to the server, it will try to reuse the same session and continue where it was. For example, your device is switching to another Wifi.

It can also happen when the user switches to another iPhone app, the OS will likely suspend Safari. As soon as the user comes back to that browser and opens that tab (without reloading the page), the framework will do its best to recover the session.

If the session has expired, the browser will reload the page automatically and a new session will be created.

Every time the browser refreshes the page, a new session will be created. The previous one will expire eventually (3 minutes by default).

I hope that helps.

4 Likes

Ok thanks

By the way, the UserTimedOut event does Nothing right? No desconnection, no session ending, just a notification?

Just a notification, yes, for example in chat application to show that user is away.