Yii 1,1,17 on PHP 7.1.2 session issued

Hello, I want to update my php version to 7.1.2. Actually i have php 7.0.11 and my application works very good but when i update my php to 7.1.2 the application don’t save the session correctly because always dispatch my method afterLogin on my WebUser(inherit of CWebUser) class. Someone have any idea how can i resolve this issue?

Thanks a lot!

<?php

class DWebUser extends CWebUser{

protected function afterLogin($fromCookie){

  Yii::log('After LOGIN fromCookie:'.&#036;fromCookie );


  &#036;forceLoginDefaultCompany=DOAuth::getForceLoginCompany();


  if(&#036;forceLoginDefaultCompany){


    &#036;this-&gt;defaultCompany=&#036;forceLoginDefaultCompany;


  }else{


    &#036;this-&gt;defaultCompany=UsersCompanies::getRoleCompany(&#036;this-&gt;getId());


  }


  if(&#036;this-&gt;defaultCompany){


    if(&#33;&#036;this-&gt;getState('company')){


      &#036;this-&gt;setState('company',&#036;this-&gt;defaultCompany);


    }


    if(&#33;&#036;this-&gt;getState('companies')){


      &#036;this-&gt;setState('companies',UsersCompanies::getRoles(&#036;this-&gt;getId()));


    }


    if(&#036;fromCookie){


      &#036;user=Users::model()-&gt;findByPk(Yii::app()-&gt;user-&gt;id);


      if(&#036;user){


        Yii::app()-&gt;user-&gt;setState('firstname',&#036;user-&gt;firstname);


        Yii::app()-&gt;user-&gt;setState('lastname',&#036;user-&gt;lastname);


        Yii::app()-&gt;user-&gt;setState('document_number',&#036;user-&gt;document_number);


      }else{


        &#036;this-&gt;logout();


      }


    }


  }else{


    &#036;this-&gt;logout();


    Flashes::set('warning',Yii::t('errors','The user don&#092;'t have an published asociated company, Please contact Company administrator.'));

// Yii::app()->controller->redirect($this->loginUrl,false);

    return false;


  }





}

}

Yes, that’s known issue. Update your Yii 1.1 to code from GitHub master: https://github.com/yiisoft/yii