I am stuck at 1 point on how to integrate Facebook using PHP to my application/website. User can login to our site using our site registration and login. But if user wants to get login through facebook then that user should be logged in to our application.
If user is logged in to facebook and goes to my site for the first time then PHP code should save his all details into our database and then allow user to access our site.
If user login from facebook now and goes to our application then he will just get logged in to our site as his details were present in database as we have saved his basic details such as username,firstname,lastname,country,state,city,gender etc details
Is there any way out to get out of this problem.