Basic Site Of Facebook Login

                                            Basic Site Of Facebook Login
Basic Site Of Facebook Login
This site uses cookies to deliver our services and to show you relevant ads and job listings. By using our site, you acknowledge that you have read and understand our Cookie Policy, Privacy Policy, and our Terms of Service. Your use of Stack Overflow’s Products and Services, including the Stack Overflow Network, is subject to these policies and terms.

Join Stack Overflow to learn, share knowledge, and build your career.
Get user basic information using facebook Login button plugin?
Ask Question
up vote 13 down vote favorite
Here I am using Facebook Login button plugin and javascript sdk
I am able to successfully login and logout by using above.
When a first time user has gone through authentication process I need to store user basic information i.e. Facebook login name, email in my database.
Please suggest how I can do this.
facebook facebook-javascript-sdk

Related Posts:
Subscribe to the event auth.login. If you do this, Facebook will call your handler after a login as happened.

In that handler, use FB.api to call the Graph API to get any information you desire. For example calling /me as shown in the second example will get you basic information about the logged in user.

Now you have all the data in JavaScript. To send that up to your server, do a plain old XMLHttpRequest/AJAX request. Your JavaScript library probably makes this easy -- in jQuery this is jQuery.ajax() -- but worst case you can use XHR directly.

Now you have the data on your server and you can do whatever you want, like store it in the database. If you only want to store the data once, just check that you haven't already stored info about that user ID yet.
Basic Site Of Facebook Login Basic Site Of Facebook Login Reviewed by Efukikata Efet on 05:10 Rating: 5

No comments