I have some PHP script that logs in and returns a JSON array with a session ID if the login was successful.
In my app, I want to login at the front page and continue out
Here are some things you should think about:
This will guarantee a bit more security and functionality than just clearing the session id on your app side.
This strategy will probably work. In an app I worked on, I stored the return data from login in the android shared preferences. If the user logged out, I cleared the preferences. This allowed users to stay logged in, even if they closed the app and went back in later. I had an authentication token that I checked to see if the user's login was still valid.
How do you plan on handling persisted logins? Does the sessionID expire? You might want to think about these situations otherwise once a user is logged in, they will be logged in forever or as long as the app is open.