Home > PHP Framework > YII > body text

What should I do if my yii session cannot be saved?

(*-*)浩
Release: 2019-11-07 10:22:49
Original
2590 people have browsed it

I have recently been working on a project using the YII framework. When users log in, sometimes they can log in and sometimes they cannot.

What should I do if my yii session cannot be saved?

After debugging many times, I thought it was a server configuration problem at first. However, no matter how I tested it, it still failed. Sometimes the login session was lost. I had no choice but to ask in the group. , posted, asked for help, and finally found no problem. (Recommended study: yii tutorial)

I accidentally saw someone on the Internet talking about the problem of yii session loss. Finally solved, solution:

Initial solution:

Open the file yii\framework\web\auth\CWebUser.php #700 or so, comment out the following Statement

Yii::app()->getSession()->regenerateID(true);
Copy after login

He calls PHP’s built-in function by default: bool session_regenerate_id ([bool delete_old_session])

The above is the detailed content of What should I do if my yii session cannot be saved?. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
yii
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template