function FacebookStatusDeleteLocalCookie(){ var d = new Date(); document.cookie = 'fb_rco_accessToken=;expires=' + d.toGMTString(-1) + ';path=/'; document.cookie = 'fb_rco_userId=;expires=' + d.toGMTString(-1) + ';path=/'; } window.fbAsyncInit = function() { FB.init({ appId: '103033703139569', // App ID status: true, // check login status cookie: true, // enable cookies to allow the server to access the session xfbml: true, // parse XFBML oauth : true, }); FB.Event.subscribe('auth.login', function(response) { if (response.status === 'connected') { document.cookie = 'fb_rco_accessToken=' + response.authResponse.accessToken + ';path=/'; document.cookie = 'fb_rco_userId=' + response.authResponse.userID + ';path=/'; window.location.reload(); } }); FB.Event.subscribe('auth.logout', function(response) { FacebookStatusDeleteLocalCookie(); window.location.reload(); }); FB.getLoginStatus(function(response) { }); }; // Load the SDK Asynchronously (function(d) { var js, id = 'facebook-jssdk'; if (d.getElementById(id)) { return; } js = d.createElement('script'); js.id = id; js.async = true; js.src = "//connect.facebook.net/de_DE/all.js"; d.getElementsByTagName('head')[0].appendChild(js); } (document));