All pastes #733762 Raw Edit

Anonymous

public php v1 · immutable
·published 2007-10-12 01:59 UTC
rendered paste body
<?phprequire_once 'facebook.php';$appapikey = 'asdfasdf9';$appsecret = 'asdfdasfas536';$facebook = new Facebook($appapikey, $appsecret);$user = $facebook->require_login();//[todo: change the following url to your callback url]$appcallbackurl = 'http://effacebook.solutions-lab.net/';//catch the exception that gets thrown if the cookie has an invalid session_key in ittry {  if (!$facebook->api_client->users_isAppAdded()) {    $facebook->redirect($facebook->get_add_url());  }} catch (Exception $ex) {  //this will clear cookies for your application and redirect them to a login prompt  $facebook->set_user(null, null);  $facebook->redirect($appcallbackurl);}?>