Facebook application: “An active access token must be used to query information about the current user”
===

i am creating a app which is a library application on Facebook. However, i kept getting this error

"Fatal error: Uncaught OAuthException: An active access token must be used to query information about the current user. thrown in /base_facebook.php on line 1106"

I am using the codes as below:




    include "dbfunction.php";
    require_once("facebook.php");

    $facebook = new Facebook(array(
      'appId'  => '123456',
      'secret' => '123456',
      'cookie' => true,
     ));
	
	$loginUrl = $facebook->getLoginUrl(array(
	'scope'=>'user_about_me, user_interests, user_likes, user_location,       friends_about_me, friends_photos, publish_stream'
	));
  
        $currentUser = $facebook->getUser();
  
       //session based graph API call
       if(!$currentUser == 0){
         header("Location:".$loginUrl);
         }
   
        $me = $facebook->api('/me');
        $myLikes = $facebook->api('/me/likes');
        $myInterests = $facebook->api('/me/interests');
        print_r($me);




How do i fix that active access token error? Thanks a lot! :)