I’ve used the facebook connect to login in to my application.
I’ve rewritten the class to login using facebook and its working fine. I’ve overwritten the logout method as such
public function actionLogout()
{
Yii::app()->user->logout();
session_start();
session_destroy();
$this->redirect(Yii::app()->homeUrl);
}
the user set by the login method is loggedout but the sessions i’ve created while logging in are not destroyed. so whenever i click the login it doesn’t go for the facebook to get credentials but just logging in automatically…
Thanks for your answers. Actually that works but the main problem is the automatic expiration of sessions!!!
when the session of Yii::app()->user expires , the session set by me are still alive and it throws an exception where a function is written after checking the session set by me.
the code is like this,
if (isset(Yii::app()->session['mid'])){
// get all friends
$this->mfriends = $mUser->getFriends(); // this function in turn requires the session of Yii::app()->user
//this is where the exception is thrown...
}
I know that just calling a function without checking all the available session is a bad parctice , but i want to know why different session expire at different time?