Home > PHP Framework > ThinkPHP > body text

What should I do if thinkphp cannot obtain the session?

藏色散人
Release: 2022-12-05 10:02:27
Original
2226 people have browsed it

thinkphp cannot obtain the session because the cookie valid domain name is not set. The solution is: 1. Open the "cookie.php" file; 2. Set the domain in the configuration to the real top-level domain name of the current project. That’s it.

What should I do if thinkphp cannot obtain the session?

#The operating environment of this tutorial: Windows 7 system, thinkphp v6 version, Dell G3 computer.

thinkphp What should I do if I cannot get the session?

Thinkphp6.0 cannot obtain the session solution

thinkphp6.0 cannot obtain the session. The reason for this problem is:

The cookie valid domain name is not set.

Solution:

Open \app\(Application)\config\cookie.php and set the domain in the configuration to your current The real top-level domain name of the project needs to be set if there are multiple applications. If there is no setting, the session value cannot be obtained, and the verification code, login, etc. may not be normal.

Recommended learning: "thinkPHP Video Tutorial"

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

Related labels:
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
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!