开发者

Auto login & logoff with facebook php

I'm looking on how to implement auto login with my website using facebook connect,

currently its working fine, but user have to clic开发者_如何学编程k connect every time they come to my site.

and is it possible to make it they logout in facebook too if they log out from my website, vice versa?

Thank you for any advice and help.


You can use FB.getLoginStatus() to ping Facebook in the background and get a user session if they have already authorized your application. Here's an auth related example which may help: http://fbrell.com/auth/all-in-one. You can also just pass the option "status: true" when you initialize your application with FB.init() to automatically trigger this check.


Whats the opposite of this ? to not login without hitting the login button.


You can use auth or oauth method to authenticate users. But as you said that you have already implemented it, please check the retrieved fb cookie so user can't login every time.

You could use a PHP auth library like:

http://gitorious.org/lightopenid

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜