This article describes how to solve the session loss problem in the Yii Framework. it solves the session loss problem by modifying the underlying code, which has some reference value, for more information about how to solve the Yii Framework user logon session loss problem, see the example in this article. We will share this with you for your reference. The details are as follows:
Recently, I used the YII Framework to log on to a project. sometimes I can log on and sometimes I cannot log on. After debugging for many times, I started to think it was a server configuration problem. I didn't know how to test it later, or sometimes the login session is lost. I couldn't help it. I asked, posted, and asked Danale in the group, no problems were found at the end.
I accidentally saw someone on the Internet saying that the yii session was lost. Finally, the solution is as follows:
Preliminary solution:
Open the file yii \ framework \ web \ auth \ CWebUser. php #700 or so, comment out the following statement
Yii: app ()-> getSession ()-> regenerateID (true );
He calls the built-in functions of php by default:
Bool session_regenerate_id ([bool delete_old_session])
It's okay now. You also need to observe for a while.
I hope this article will help you design PHP programs based on the Yii Framework.
For more information about how to solve session loss caused by logon to Yii Framework users, visit PHP!