User Time Out

I am developing an application, which uses a web page for the administrator and a different one for the mobile user.

Only the admin will leave their screens active, to see statistics in real-time.

For mobile, I want to see if it is possible to disable the timeout. This is because users will interact periodically, but they have to stay logged in for time-sensitive data.

Is there a way for users to stay logged in and not have them log out after idle or unfocus?

I have some webapps where I code Session.Timeout = 0 to prevent the Session from running its Session.TimedOut event handler. But if you have no code in the Session.timedOut event then setting Session.Timeout to any value has no effect anyway.

Then there is App.SessionTimeOut which is completely different. This closes the user’s Session if the server fails to hear from the client for a given time period. This does not look for user interaction - this looks for browser ping / handshake data.

Not all browsers are born equal, but I can confirm that with Windows 10 running Chrome Browser, If the user keeps their browser tab open (even if that tab does not have focus) the Session will remain “live” indefinitely. I have a temperature monitoring app which does exactly that. However, if the device goes into sleep / suspend mode, then App.SessionTimeout will apply.


Thanks for your answer.

If I put in the Opening event of Session, the following code:

Self.UserTimeOut = 0
App.AutoQuit = False

It should work ?

Note.- Session.Timeout = 0 XOJO does not recognize it. Neither does App.SessionTimeout.

What version of Xojo ??

XOJO ver. 2021 Release 1.1

Ah, yes, sorry web api 2 has different language. Yes Self.UserTimeOut = 0 is correct.

App.AutoQuit is not really relevant, because AutoQuit is invoked ONLY when there are 0 sessions existing. Therefore if a user has a browser session that is open, AutoQuit will not happen.