Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6692745
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T05:54:10+00:00 2026-05-26T05:54:10+00:00

FB.ui( { method: ‘feed’, name: ‘some text’, link: ‘some text’, picture: ‘aa.jpg’, caption: ‘some

  • 0
FB.ui(
       {
         method: 'feed',
         name: 'some text',
         link: 'some text',
         picture: 'aa.jpg',
         caption: 'some text',
         description: 'some text',
         message: 'some text'
       },
       function(response) {
         if (response && response.post_id) {
            alert('Post was published.');               
        } else {
            alert('Post was not published.');
         }
       });
}

That code WORK fine, now i like after :

alert('Post was published.');

to be logged out from facebook, silently
HOW ?

Adding that code After the alert('post publish') did not do anything !!

FB.ui(
 { method:'auth.logout',  display:'hidden' },
 function() { alert("you're logged out!"); }
);

i have found : FB auth.logout is being raised after being logged in using the "server-side-workflow" (OAuth 2.0) but not sure i understand the code enough to know it do what i ask !

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-26T05:54:11+00:00Added an answer on May 26, 2026 at 5:54 am
    1. https://developers.facebook.com/docs/reference/javascript/FB.getLoginStatus/

    2. https://developers.facebook.com/docs/reference/javascript/FB.logout/

    Best Practices

    FB.logout will log the user out of both your site and Facebook. You
    will need to have a valid access token for the user in order to call
    the function.

    Calling FB.logout will also invalidate the access token that you have
    for the user, unless you have the offline_access permission.

    I wrote a sample using the comments box to fire the auto logout
    http://shawnsspace.com/fb.logout.test.php

    THE CODE:


        <div id="fb-root"></div>    
        <script>
          window.fbAsyncInit = function() {
            FB.init({
        appId  : '112104298812138',
        status : true, // check login status
        cookie : true, // enable cookies to allow the server to access the session
        xfbml  : true, // parse XFBML
        //channelUrl : 'http://WWW.MYDOMAIN.COM/channel.html', // channel.html file
        oauth  : true // enable OAuth 2.0
            });
    FB.Canvas.EarlyFlush.addResource("http://shawnsspace.com/index.php");
    FB.Canvas.setAutoResize();
                FB.getLoginStatus(function(response) {
                  if (response.authResponse) {
    
                    var accessToken = response.authResponse.accessToken;
                  } else {
                  }
                }); 
        FB.Event.subscribe('comment.create', function(response) {
         //alert(JSON.stringify(response));
            FB.logout(function(response) {
            window.location.reload();
            });
        });
            FB.Event.subscribe('auth.login', function(response) {
            //top.location.href = 'http://apps.facebook.com/shawnsspace/fbcomments.php?ref=loggedin';
            window.location.reload();
            });
            FB.Event.subscribe('auth.logout', function(response) {
            //top.location.href = "http://apps.facebook.com/shawnsspace/fbcomments.php?ref=loggedout";
            alert('logged out');
            });
          };
          (function() {
            var e = document.createElement('script'); e.async = true;
            e.src = document.location.protocol +
              '//connect.facebook.net/en_US/all.js';
            document.getElementById('fb-root').appendChild(e);
          }());
    </script>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

What method do I call to get the name of a class?
the method is: def printa(x): return x the response is: self.response.out.write(template.render(path, {'printa':printa})) the html
/* Method: findName() */ /** * Finds the name of the entry and sets
This method notifes an event loop to start processing a message. However, if the
method is the most efficient when translating bunches of text/web pages including HTML? I
This method: public static string[] getKeywords(string filename) { string[] keywords = XElement.Load(filename).Elements(Keyword).Attributes(name).Select(n => n.Value).ToArray
RetainAll method function is in java what is alternative method in objective-C sample code
Method overloading allows us to define many methods with the same name but with
Method chaining is the only way I know to build fluent interfaces. Here's an
Method chaining is the practice of object methods returning the object itself in order

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.