I'm trying to avoid that when a user has connected to Facebook from my webview, the next time he do it, doesn't need to put the email and password. I'm getting the cookie from the "facebook.com" domain with this sentence:
String cookie = CookieManager.getInstance().getCookie("facebook.com");
and storing it in a SQLite database. When the user try to connect another time to Facebook, I use this sentence after removing all another cookies:
CookieManager.getInstance().setCookie("facebook.com",开发者_运维百科 user_acc.getSessionCookie());
but doesn't work. That cookie I suppose that is not valid because the user has to put his username and his password again and after login, I get a different cookie that the one I had stored.
What I'm doing wrong? Is there another way to accomplish that?
Thank you in advance.
I think you can't do this via cookie because this cookie is valid for only that session and as soon as user logout that cookie expires though you are storing that cookie in your database for facebook that cookie was never created that is why it is asking user name pwd again. I think best way is to click remember password
I think this will solve your problem this is announced today check if this can work http://techcrunch.com/2010/11/03/facebook-single-sign-on/
Well, I've found the solution. If I get all the cookies doesn't work, but if only get the m_user cookie all works fine.
Thank you Parry for your answers.
Regards.
精彩评论