2

I need to work out how to check to see if the user logged in on facebook is the same user that is already logged in on my web app.

I'm using code igniter for my web app and storing the users fb id in a session called fb_user_id.

How can I match this with the logged in user on facebook to prevent users logging out and logging in to another account on facebook and then using my app again before the session has expired?

Gunnar Karlsson
  • 28,350
  • 10
  • 68
  • 71
Ben Gordon
  • 437
  • 3
  • 10
  • 23

1 Answers1

0

The User table has an online_presence field you can use. You'll need the user_online_presence permission.

The FQL query:

SELECT online_presence FROM user WHERE uid=me()

will return

"online_presence": "offline"

if you're app's current user is logged out of facebook.

See also:

How to check if a user is logged into facebook using his access_token and graph api

Community
  • 1
  • 1
Gunnar Karlsson
  • 28,350
  • 10
  • 68
  • 71