logo
Ask your Symfony questions! Pay money and get answers fast! (more info)

This is an old version of this answer!

Return to the current answer
Hi,


Just call the sfGuardSecurityUser::signIn with an extra parameter :


$user = sfGuardUserPeer::retrieveByUsername($email);

// Please note the use of "instanceof" in the condition
if ( $user instanceof sfGuardUser )
{
$this->getUser()->signin( $user, true ); // TRUE means "remember me"
$this->setFlash('notice', 'You are logged in');
$this->forward('user', 'home');
return sfView::SUCCESS;
}



For more details, see sfGuardPlugin code source :
http://trac.symfony-project.org/browser/plugins/sfGuardPlugin/branches/1.3/lib/user/sfGuardSecurityUser.class.php#L78


Julien

JuG | 07/27/10 at 2:06am

This is an old version of this answer!

Return to the current answer