0

I have the following code in yii

$identity=new UserIdentity($username,$password);
if($identity->authenticate())
{
    Yii::app()->User->login($identity);
    $this->redirect(array('site/index'));
}
else
{

}

It works fine on XAMPP in Windows environment. But when i test it in Mac OS it gives the following error

session_regenerate_id(): Cannot regenerate session id - headers already sent

Can anyone explain why this is happening and fix the problem?

Thanks in advance

Bahdeng
  • 434
  • 8
  • 17
  • http://stackoverflow.com/questions/8028957/headers-already-sent-by-php/8028987#8028987 – Ast Derek Jul 02 '13 at 07:01
  • Already 2 duplicates, one with answers http://stackoverflow.com/questions/6756021/session-regenerate-id-headers-already-sent-in-unit-testing-yii-controller http://stackoverflow.com/questions/11580140/yii-error-session-regenerate-id However this problem occurs when using "Remember me" feature and session expired, and there is no real answer, only workarounds. –  Jul 02 '13 at 12:48

0 Answers0