Reputation: 1
I have an iframe application. When a user and another page and log in to facebook site, the application page is reloaded by facebook. But, I want to reload the page in the logout state also.
Here is the scenario:
When user logs out from facebook, I want to automatically reload my application page in the browser.
How can I do this?
Upvotes: 0
Views: 1383
Reputation: 3001
Unfortunately, your options are limited as communication with an IFRAME is very constrained. This may help you:
http://www.dyn-web.com/tutorials/iframes/refs.php
Upvotes: 0
Reputation: 174
Have a look at FB.Event.subscribe, I think you should be able to use it to reload the page when the user's session changes.
Add something like this to your FB.init:
FB.Event.subscribe("auth.sessionChange", handleSessionChange);
...and the handleSessionChange callback function would look something like this:
function handleSessionChange(response) {
if(!response.session || response.session.uid!="$user_id"){
window.location.reload();
}
}
Upvotes: 2