I have an application which uses wcf web service and after successful login, i want to activate a session of 10 minutes. If user is idle or app is in background for 10 minutes then session should expire and app should ask for login details again.
I have used keychain for storing username and password and it works But i want to add the session so that user is redirected to main page if session is not expired and to the login page if session is expired…
I know this is repeated question but i had to write it since i am not getting proper answer from other questions. Please help..
use this Link this works me.
use NSUserDefault to create Session for ios.
i also created Session in ios with this Tutorial.
EDIT:
i have a Login Screen in first Page of My application
if Login is Successfull authenticate by server then i stored my Username & Password in NSUserDefault Like this way:
Onclick of Login Button. & redirected to Dashboard.
In dashboard Logout Button is there if user click Logout Delete All Data Like this way.
& On other condition when user close app The NSUSerDefault Are stored when u second time open app at that time Check wheather username & password stored in NSUserDefault
During
ViewDidAppearof Loginpage.If sucessfull then Redirected to Dashboard.