I have the standard Facebook login button on my homepage and I don't want people to automatically log into my site with their Facebook account, only if the user clicks the login button.
If the user is not logged in Facebook, a popup will appear asking him his credentials and he will be redirected to loggedin.html after that.
<div id="fb-root"></div> <fb:login-button perms="email"></fb:login-button> <script> window.fbAsyncInit = function() { FB.init({ appId : 'xxxxxxxxxxxx', status : true, cookie : true, xfbml : true }); FB.Event.subscribe('auth.login', function() { window.location = "loggedin.html"; }); }; (function() { var e = document.createElement('script'); e.src = document.location.protocol + '//connect.facebook.net/en_US/all.js'; e.async = true; document.getElementById('fb-root').appendChild(e); }()); </script> If the user is already logged in Facebook, when he clicks the button the popup appear and disappear right away, I am OK with that. But the user is not redirected to loggedin.html. How can I do that ?