I have recently noticed that in a mobile app the GetUserId() function sometimes returns a NullIdentifier or Zero. I suspect it has something to do with a timeout of the mobile authentication for the logged in User?

Reading this article https://success.outsystems.com/Documentation/10/Managing_the_Applications_Lifecycle/Secure_the_Applications/Configure_Mobile_App_Authentication does this mean that if a Mobile app that requires Login is idle (in this example where max idle time = 30 mins) then the user authentication would essentially be revoked or lapse and from that point the GetUserId() would return a NullIdentifier, similar to a session timeout in a web app.



A quick test shows that with my Mobile Max IdleTime set to 30mins in my personal environment the GetUserId() function returns a NullIdentifier (or 0) after approx 60mins. While the app continues to work? Is this expected behavior?

In a further test leaving the app idle for 3 hrs GetUserId() returned the correct UserId? 

So why does it sometimes fail?


Did you manage to fix this problem? or did you find out more?

Best regards,



I would also be interested in more information around user session management. 

I find it hard to predict the exact lifetime of a valid session which makes handling expired sessions tricky.



I never really understood exactly why this happened. I simply implemented (and continue to implement) a workaround by storing the userid in a local session table at logon and referencing that. Remove it at log off and/or implement logic to control your own idle time out.