I'm building a site that allows users to sign in using their facebook account.
I want to cache nice big versions of the users profile pictures. I know that i'm not allowed to cache images for more than 24 hours so i'm going to re-fetch the images once every 24h.
I thought i could get the url of the image original like this:
$fb=new Facebook($key,$secret);
$query = "SELECT src_big FROM photo WHERE pid IN (SELECT cover_pid FROM album WHERE owner = ".$id." AND name = 'Profile Pictures')";
$imgurl = $fb->api_client->fql_query($query);
http://wiki.developers.facebook.com/index.php/Photo_(FQL)
But i get an exception saying "Requires user session". Why do i need a user session? Is there a workaround for this? How does other sites solve this?
If i have a user session it works for some users but not all. Why not?