views:

761

answers:

1

hi,

  1. I am in the conversion process of facebook app from fbml to iframe.

Now i am testing using few iframe pages.

$user = $facebook->require_login();

It gives the current user logged in. Once it get the variable from the facebook.com it saves in cookie by the PHP API provided by facebook). I logged out using another tab of facebook and i tryed using my app without refreshing the whole site (by just using the links inside my app). It still gives the $user variable.

It indicates that user has logged in instead of user logged out.

Please help me out. I want my app secured.

  1. It looks my iframe app accessible when we select "open this frame in new window". I need a solution for this too.

Thanks in advance.

A: 

You are logged in as far as you are logged in facebook. You will have to create custom PHP's session handling. However, if you want to remove the user from application's cookies, you can do this:

//this will clear cookies for your application and redirect them to a login prompt
$facebook->set_user(null, null);
$facebook->redirect($appcallbackurl);
Sarfraz
hi,Thanks for you reply.I have this piece of code. Can you tell me at what condition i need to trigger this code.When the PHP API cookie expires this code will trigger checkout below code. But I want this code to be triggered when user is no longer active (logged in) in facebook.try { if (!$facebook->api_client->users_isAppUser()) { $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($facebook->get_login_url($app_url, 1));}
itsoft3g

related questions