I'm developing a Facebook iframe/Facebook Connect application with PHP client library. In my index page, I check if the user is logged in by using require_login()
.
$user_id = $facebook->require_login($required_permissions = 'user_location,publish_stream,email,read_stream,user_about_me,user_activities,user_birthday,user_events,user_groups,
user_hometown,user_interests,user_likes,user_status,user_photos);
Thus I get the $user_id of the user in that page. But in the subsequent pages, If I use require_login() to get the user_id, some prablem occurs and the page ie not redirected. The page gets refreshing and nothing is displayed.
So I tried using $user_id = $facebook->get_loggedin_user();
but then I dont get the user id in the variable.
If I use $user_id = $_GET[fb_sig_user];
, sometimes I get the value, sometimes I dont. Please suggest me the proper method to get the user_id in other pages too.