i have the following code:

```
$facebook = new Facebook(array('appId' => $FB_APP_ID,
                             'secret' => $FB_APP_KEY,
                             'cookie' => true));
$fb_sess = $facebook->getUser();

if (empty($fb_sess)) {

  $url = $facebook->getLoginUrl(array('response_type'=>'token',
                                        'scope' => 'email'));
  header("Location: $url");

}

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

```

The problem is that $fb\_sess is always 0, so empty($fb\_sess) is always true, and so the redirect to the login URL repeats Endlessly. my app seems to be correctly configured and i'm using the latest PHP SDK. any clue to fix that or at least get an idea of what's happening ?