facebook active access token problem

An active access token must be used to query information about the current user

Solution:
changing the line:

$me = $facebook->api('/me');
to
$me = $facebook->api('/'.$uid);