webtechnick/CakePHP-Facebook-Plugin — Issue #43: Unable to log out issue 
Author: tspesh
Created: 2011-12-20 03:07:32+00:00
State: open

So I've got the system working half-well. When I log into facebook, it logs me into my cakePHP app.

In my users/logout function, I redirect back to the homepage.

I've routed the facebook logout to my logout function in my users controller. When I use that, the logout logs me out of facebook but not on my cakePHP app.

When I log out by going just to the logout function while still logged into facebook (and not logging out of facebook), nothing happens.

I removed the redirect from the logout function and when I sign out, it appears to work, but when I navigate back to the home page (or any other page), it logs me back into my cakePHP app.

My solution for this was to manually delete the entire session before I redirect

function logout()
{
$this->Auth->logout();
$this->Session->destroy();
$this->redirect(array('controller' => 'articles', 'action' => 'index'));
}

While this appears to be working, I'd like to know why it's necessary? What am I doing wrong here??