I was wondering if its possible to get LOGGEDin facebook user_id once they visit my website, without click on any login or fb.connect or even using API ? can we get facebook logged user_id开发者_运维知识库 ?.. cheers
You can not get the logged in facebook user_id without using the API because it not only violates the browser's security, but also Facebook's (not to mention the user's privacy).
Yes, you can use the javascript API. Use the FB.getLoginStatus function. If they are logged in, the session will contain their user ID.
You seem to be confused, let me try to clear a few things up.
When you say "without the API" what you seem to mean is "without them giving permission." Even if you don't use "The API", you'll still be required to get permissions before you're able to get access to their account data using your access token.
If you're looking for ways to have Facebook stuff on the page that doesn't require authentication, try Facebook's Social Plugins: https://developers.facebook.com/docs/plugins/ Basically, they run inside of a Facebook , so the user is interacting with a Facebook widget on your page, but your server doesn't get any access to their data.
精彩评论