0

I've been looking for a solution for this about two days and cant seem to find it...

I've triend lots of things I even created an Global class that can receive the session the user got when logging in but it doents work... when I set for example, lblNotify, it receives the msg:

   public void logoutProcess()
    {
        if (Global.facebookSession.getActiveSession() != null) {
            Global.facebookSession.closeAndClearTokenInformation();
            lblNotify.setText("found this session");
        }

        Global.facebookSession.setActiveSession(null);

    }

But nothing happens, when I close the app and open it again my user is still logged in...

Also this is my global function

public class Global {
    public static Session facebookSession;
    public static String usuName;
}

That I'm setting onCreate of the MainActivity like that:

   Session.openActiveSession(this, true, new Session.StatusCallback() {

        @Override
        public void call(Session session, SessionState state, Exception exception) {

            Global.facebookSession = new Session.Builder(this).build();                   
            if (session.isOpened()) {
                Request.newMeRequest(session, new Request.GraphUserCallback() {
                    // callback after Graph API response with user object
                    @Override
                    public void onCompleted(GraphUser user, Response response) {
                        if (user != null) {

                            Global.usuName = user.asMap().get("name").toString();

                        }
                    }
                }).executeAsync();

            }

        }

    });

Any idea?

Thanks!

Diogo Garcia
  • 536
  • 1
  • 8
  • 20

1 Answers1

0

I thin I found the problem...since I have the official facebook application still logged in it will authenticate silently again. I'm thinking about creating a "isLogged" var and store it so that when someone logout and restart the app it will not even verify if the user is logged bypassing facebook's session verify.

Diogo Garcia
  • 536
  • 1
  • 8
  • 20