Back Button

Hello Community,

we developed a web app with Xojo. The app has the behaviour that if the user refreshes the URL the website prompts the log in dialog. Or if a user uses the back button of the browser and afterwards uses the forward button, the user has to login again to the web app (he or she won’t see the window he or she saw before). I think we made something wrong. Can anybody give me a tipp how to avoid this behaviour?

In this forum we can use the back button and it works fine.

Thank you in advance, Torsten

Go search the WEB forum. You will find some references to WebpageSession.ConfirmMessage. You can’t stop a user from using the BACK button but you can warn them with a custom message.

I use this in a login screen. Right before exiting the screen with a successful login I set the message. When the SHOWN even fires for the login screen I set the message to an empty string. This way the custom message appears ONLY if you are logged in. This avoids the problem to simply exit the browser or go to a new URL when you are NOT logged in. If you don’t have a login screen you will have to figure out your own logic to set the ConfirmMessage to an empty string or put up with a message when you try to navigate out of your app at a point you allow that to happen.

Thank you for that informatione.

We want, that the user can use the back button and after he or she comes back to the Xojo web app he or she should see the same window before, without login. The web app should remember the session. Is that possible?

If not, I will do it like your advice above.

You can set a cookies to avoid the login and remember which page they were on (have to save/update the cookie on every page). But refreshing or “going back” to a Xojo web app will always load a new session, which takes time. Thus the advice to try to prevent the user from doing that to begin with.

You’ll see the same behavior in other web apps, like gmail.

Maybe the compromise is to use the text of the Confirm Message to say something like:

Please open a new TAB for your second application rather than using the BACK Button. If you use the BACK Button you will be signed out.

Tabs would provide “instant” switching so that is how you “sell it” to the user as a better solution.

This is a user behavior issue coupled with a part of the app you cannot control … the browser.