FB.Event.subscribe('auth.login', function(response) {
FB.api('/me', function(response){
//Some operation
});});
Above piece of JavaScript code runs when user logs-in through Facebook
or
when user is already logged-in the browser and you open the page containing the above JavaScript.
Is there any way to execute the operation only when user logs-in for first time and escape the operation when user is already logged-in in the browser?
Run FB.getLoginStatus to see if the user is already connected to your app and logged in.
https://developers.facebook.com/docs/reference/javascript/FB.getLoginStatus/