I am new in iOS development. I am using NSURLSession to manage session information. below is the sample code I use to call any server API,
NSURLSessionDataTask *task = [[NSURLSession sharedSession] dataTaskWithRequest:request
completionHandler:^(NSData *data,
NSURLResponse *response,
NSError *error)
{ }];
My flow of application is, If not logged in -> Login (call login api) Else Go to home screen and call other APIs.
My problem here is, once the application is removed from memory, the session information is not maintained and I have to call Login again. My requirement is something like Facebook, where user has to login only once and his session is maintained throughout next app launches.
EDIT: I think I have to handle this by getting and setting cookies to these requests. I searched on this but didn't found any proper sample. can anyone please help me with some good sample regarding my issue.
Thanks!