Session Error

Hi all,

I just put my web app on my host and although it is working on my machine I am getting the following error when attempting to access my app:

session_regenerate_id() [<a href=‘function.session-regenerate-id’>function.session-regenerate-id</a>]: Cannot regenerate session id - headers already sent

I have traced the error back to my class EWebUser which is found below:\

class EWebUser extends CWebUser{


    protected $_model;


    function isAdmin(){

        $user = $this->loadUser();

        if ($user)

           return $user->accessLevel==LevelLookUp::ADMIN;   



    // Load user model.

    protected function loadUser()


        if ( $this->_model === null ) {

                $this->_model = LoginAll::model()->findByPk( $this->id );


        return $this->_model;



class LevelLookUp{

      const ADMIN  = 99;

      // For CGridView, CListView Purposes

      public static function getLabel( $level ){

          if($level == self::ADMIN)

             return 'Administrator';

          return false;


      // for dropdown lists purposes

      public static function getLevelList(){

          return array(





Any advice on why this is occurring on the web host but not my machine, and how to fix this?

Make sure there’s nothing before <?php. Then check your file for BOM.

Thanks solved!