A common piece of functionality for native mobile applications is the ability to stay logged in even if the user closes the application in question (see e.g. the Facebook app on iOS).

How can this be achieved for a Cordova / Ionic / PhoneGap app authenticating against a Rails backend via username/password?

I'm using the devise\_token\_auth gem to facilitate authentication against Rails if that makes a difference.