php - How to solve "session_regenerate_id(): Cannot regenerate session id - headers already sent" -


as has moved yii app other shared host , app runnig ...index.php?r=site/login login credentials got warnig:

session_regenerate_id(): cannot regenerate session id - headers sent 

the actionlogin''s code:

public function actionlogin($name = null ) {     $model=new loginform;     if ($name) $model->username = $name;     if(isset($_post['ajax']) && $_post['ajax']==='login-form')     {         echo cactiveform::validate($model);         yii::app()->end();     }     if(isset($_post['loginform']))     {         $model->attributes=$_post['loginform'];         // validate user input , redirect previous page if valid         if (headers_sent($filename, $linenum))                {             echo "headers have been sent in {$filename} line number {$linenum}\n"             exit;         }          if($model->validate() && $model->login())             $this->redirect(yii::app()->user->returnurl);     }     // display login form     $this->render('login',array('model'=>$model)); }     

the docs , forums have said problem bom. yet in notepad++ files saved utf-8 without bom. should special check of files? ones? or there might other cause of error?

i've added headers_sent($filename, $linenum) function (see in code above) trace sent headers no result.

use

ob_start() 

at start of file.


Comments

Popular posts from this blog

c++ - CryptStringToBinary API behavior -

c++ - Correct method for redrawing a layered window -

java.util.scanner - How to read and add only numbers to array from a text file -