Objective C / php session?
The user inputs their use开发者_如何学Crname and password to log in the first time. If success i create a php session On subsequent requests,the php session is lost, so how should I send the username/pass again? Can I have our server send a cookie to the app and have the app send it back using NSURLConnection or something?
Is it possible to provide a simple example?
Thanks
How about storing username and password on the device and then automatically logging in when the app is started in the future? That can easily be done using NSUserDefaults.
// SET
[[NSUserDefaults standardUserDefaults] setObject:@"MyUsername" forKey:@"username"];
// GET
NSString *strUsername = [[NSUserDefaults standardUserDefaults] stringForKey:@"username"];
Sorry if I didn't understand the question.
精彩评论