W
whenshaw
Guest
If an acceptable solution is to stop the timeout from happening, you could try pinging the server on some interval, so the server receives a request even if the user doesn't do anything. You can have the Session service ping for you by setting its pingInterval property 0 (the number specifies milliseconds). You can do this by adding a "Run JavaScript" handler on Success of SessionService_Login. Here's an example that sets the ping interval to 5 seconds: If you want to catch the error from a timeout, you are correct that you can use the Offline event available in the Mobile App Builder. Specifically, you need to use the Offline event of the SessionService_Session object (in an Express app generated for you by PDSOE, it is named DefaultSession -- see the example below). This event should fire if the JSDO makes a request that fails due to a session timeout (it might fire for other reasons too, of course). I think it would be somewhat complicated to automatically log back, but we can give you some specific suggestions if you want to try that approach (and you are correct to be concerned about security -- you would need to store the credentials securely, of course). Regards, Wayne
Continue reading...
Continue reading...