i have implemented facebook log in using Facebook javascript SDK in Jquery mobile , now the problem is i want to persist connection through out all the pages as when ever i refresh the page i need to fire FB.Login again.
Moreover do i need to include following code in every html page to access the FB object ?
<script>
window.fbAsyncInit = function() {
FB.init({
appId : 'XXXXXXXXXX', // App ID
status : true, // check login status
cookie : true, // enable cookies to allow the server to access the session
xfbml : true // parse XFBML
});
// Additional initialization code here
};
// Load the SDK Asynchronously
(function(d){
var js, id = 'facebook-jssdk'; if (d.getElementById(id)) {return;}
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);
}(document));
</script>
Yes. You should include initialization of JavaScript SDK on every page.
JavaScript SDK should set cookie automatically (as you set in
FB.initcall parameters) so you doesn’t need to callFB.loginon every page