Home Fb.Logout function doesn't log user out
Reply: 0

Fb.Logout function doesn't log user out

user1400
1#
user1400 Published in June 21, 2018, 8:39 am

I've created a one page application where the idea is to log user in with facebook, get the basic details and log him out of facebook. It's kind of a promotional feature so once one user logs out the other user is asked to log into his facebook account.

This works like this, when a user clicks on Facebook login button on the website, I use FB.login and FB.api methods to get user data. That works fine. Now, when the user fills in some extra fields, and click submit and logout button, I'm storing user data via AJAX call and then calling FB.logout.

Now, this works perfectly on local machine but on the server, as soon as FB.logout method is called, it gives the following error:

**

Load denied by X-Frame-Options: https://www.facebook.com/home.php does not permit framing.

**

This is the code I'm using:

window.fbAsyncInit = function () {
    FB.init({
        appId: APP_ID,
        channelUrl: apiUrl + 'channel',
        oauth: true,
        frictionlessRequests: true,
        status: true, // check login status
        cookie: true, // enable cookies to allow the server to access the session
        xfbml: true  // parse XFBML
    });

The Fb.login and Fb.logout is as it should be and Fb.login is working. Just the FB.logout that gives the error on server.

You need to login account before you can post.

About| Privacy statement| Terms of Service| Advertising| Contact us| Help| Sitemap|
Processed in 0.472951 second(s) , Gzip On .

© 2016 Powered by mzan.com design MATCHINFO