Hi,
I added Facebook Connect to my site and it works well.
This is what I do to detect that a user is logged in and it works fine:
require_once 'library/ext/facebook-platform/php/facebook.php';
// Find out Facebook Connect status
$facebook = new Facebook($this->_config->facebook->appapikey,
$this->_config->facebook->appsecret);
$facebookUserId = null;
try
{
$facebookUserId = $facebook->get_loggedin_user();
}
catch(Exception $fbException)
{
// The facebook connect status could not be determined
$facebookUserId = null;
}
// Check if we can find the Facebook member
if (!is_null($facebookUserId))
{
.... log the user on
However, my problem is that only resetting the browser will get rid of the
cookies that make get_loggedin_user think that the user is still logged in:
What I do at logout is the following:
// Destroy the session and redirect
Zend_Session::destroy(true, true);
// Get the Facebook object
$facebook = new Facebook($this->_config->facebook->appapikey,
$this->_config->facebook->appsecret);
try
{
// Logout the Facebook user and redirect
$facebookUserId = $facebook->logout("http://gogoverde.com");
}
catch(Exception $fbException)
{
// Ignore and log only
GgvLogger::log(GgvLogger::formatException($fbException),
Zend_Log::ERR);
}
The browser redirects to Facebook and logs the user out but then when I get
back to my site, I am still logged on. Now I have tried to comment out the
destroy session, tried an expire session instead and in addition to logout.
Nothing gets rid of the cookies (tried both in FF and Safari). Now I realize
this is not primarily a ZF issue, but I wonder if anybody has run into the
same problem and has some advice. I searched and tried everything on the FB
wiki and solutions that had been suggested in Forums without success. Any
help is greatly appreciated.
--
View this message in context:
http://n4.nabble.com/Zend-Framework-and-Facebook-Connect-tp2017688p2017688.html
Sent from the Zend Framework mailing list archive at Nabble.com.