O'Reilly logo

Facebook Cookbook by Jay Goldman

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Get Logged-In User

Problem

I need to find the current loggedinuser’s uid.

Solution

Use the very simple Users.getLoggedInUser() method:

$currentUser = $facebook->api_client->users_getLoggedInUser();

Discussion

Users.getLoggedInUser() returns the uid of the current loggedinuser.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required