webtechnick / CakePHP-Facebook-Plugin

CakePHP Facebook Plugin
http://facebook.webtechnick.com
445 stars 138 forks source link

logging out using logout url does not logout facebook user #162

Open micopcm408 opened 10 years ago

micopcm408 commented 10 years ago

I am trying to logout directly from url (users/logout). It does logged out after redirect. Then when I refresh the page, it's logged in again. But when logging out using the logout link generated by the helper, it logouts completely with no issue. Is it possible to logout a facebook user using users/logout?

scrx commented 10 years ago

Helper detects existing facebook session and login you again, what you can do is create logout button like this

echo $this->Facebook->logout(array('label' => 'Logout', 'redirect' => array('controller' => 'users', 'action' => 'logout'))); 

this will logout you from facebook and redirect you to users/logout where you can continue and do like auth->logout()

NickBusey commented 9 years ago

Make sure your users logout method includes: $this->Session->destroy();