$user = $facebook->getUser() returning 0 everytime. Am using the latest SDK

Rambo_pang43200

New Member
Am using below code to check whether the user is logged in or not to Facebook.\[code\]<?php// Awesome FB APP // Name: MyAPP require_once 'facebook.php';// this line calls our facebook.php file that is the //core of PHP facebook API// Create our Application instance.$facebook = new Facebook(array( 'appId' => '250941738370233', 'secret' => 'xxx', 'cookie' => true,)); // all we are doing is creating an array for facebook to use with our $user = $facebook->getUser();echo $user;//app id and app secret in and setting the cookie to trueif($user){try { $user_profile = $facebook->api('/me');} catch (FacebookApiException $e) { error_log($e); $user=null;} // this code is saying if the session to the app is created use }//the $me as a selector for the information or die?>\[/code\]But the $user is responding 0 everytime. Am badly stuck at this point. Can someone help me out here.
 
Top