/** * Logouts the user * * @param myUser $userSf */ public static function logout(myUser $userSf) { $user = PcUserPeer::retrieveByPk($userSf->getAttribute('userid')); $userSf->setAuthenticated(false); $userSf->setAttribute('userid', 0); $userSf->clearCredentials(); // {{{ this should not be necessary...but just in case unset($_SESSION["symfony/user/sfUser/credentials"]); unset($_SESSION["symfony/user/sfUser/authenticated"]); // }}} self::resetRememberMeCookie(); sfContext::getInstance()->getEventDispatcher()->notify(new sfEvent('customAuthLogout', 'custom_auth.logout', array('user' => $user))); }