I need to manage server sessions in iPhone. As I researched there are many ways. One way is to use the apple native method calls by make use of the NSURLConnection and NSHTTPCookieStorage classes. However using the 3rd party libraries like ASIHttpRequest 开发者_如何学JAVAcan also be helpful cos it already has implemented the above scenarios. So what will be the best approach for me to maintain the server session in my iPhone. I need to track the following,
1) Login, Logout mechanisms in server.
2) Sever session timeout.
Also does this cookie work as a normal browser cookie? Does it get invalidated after the life time of cookie has expired?
Regards,
Dilshan
Well, the best approach is the one which works best for you.
I like ASIHTTPRequest, personally. It can be setup to use the global cookie store for session management.
Your server-side code will have some ramifications here, as well. So bear that in mind with things like your timeouts, etc.
精彩评论