What is the best way to keep a session on an iPhone app? I want something similar to this:
- when I Log in the app must store the person that name of the person
that logged in
- when I Log out that session will be destroyed without no possibility to enter the app beside logging in again
- when the app is put in background the session must be kept
- when the app closes the session must be destroyed and the user must log in again when he opens the app
How can I store the session on the phone and have this functionality's? The login is made using CoreData and the databases are stored on iCloud.