How do apps like instagram, twitter etc. Know a user is logged on and when next the user starts the app, the user doesn't have to input their credentials all over. Is it by writing and reading from a file, if  yes, doesn't it mean a user can find the file that the app reads from, alter it's content and change who's logged on to someone else without authentication
Save their token in LocalStorage for web front-end, for other platform 
you can save in somewhere that can storage.
Token-Based api. (access with token with any resource)
How to keep a user logged on