problem with intergating facebook session in iphone with objective-c
How to handle seesion in facebook . when user logs into my appliaction i want to keep the user logged in always which means that every times the user will open the application, he will not need开发者_StackOverflow中文版 to make login again.
and when the user enter to my iphone applicaiton, the user should be shown as loggedin, and when i try to post to the user wall facebook tells me that the session is inavlid.
Do what the browser does: hold onto the session cookie. When it is unavailable or expired, submit the user's credentials again. It is probably best to expire the session cookie whenever the app exits, and use saved credentials when you start the app again.
Also note that it is a security risk to not require a logon each time the app starts. If the phone is stolen, the thief can use it to access the user's Facebook account. At the very least, be nice and ask for the user's permission before caching their password, and warn them about the risks.
精彩评论