In general, I'd say that this is bad practise – Mendix Native sessions can stay alive indefinitely if you configure them to be so; in that sense, a user only has to log in once – that's the whole point of having an app. In my opinion, that would be safer, than storing the credentials client side for everyone to see, or something like that. I get the feeling here that you chose to make end the Native session rather soon, so other device users will not be able to access sensitive data. In such cases, it would be more practical to call on the security features available within the client; maybe face recognition, or finger print, or a simple code. I cannot think of a valid reason why a standard user would want to be logged out on his own device.
That being said, If you really want to do this, it might be possible to add the properties to the text widgets to allow them to call on the same functions within the OS – more info on that here. You will also have to set up an associated domain for you app, but that might be done automatically by the build process if you're lucky ;-)
Hope this helps,