Home  >  Article  >  Backend Development  >  $SESSION is lost after PHP upgrade_PHP tutorial

$SESSION is lost after PHP upgrade_PHP tutorial

WBOY
WBOYOriginal
2016-07-14 10:11:401267browse

It is necessary to upgrade the PHP version of an internal system in the production environment from 5.3 to 5.4.16

After it was generated, I found that I couldn’t log in. I interrupted all the way and found that when the two pages on the server jumped, I couldn’t get $SESSION

Sadly, I went online to look for solutions, and found various opinions,

First check the browser cookie, the cookie is available, and the sessionID can be obtained normally

Looking at the code again, the code is written very normally, with session_start at the beginning and $SESSION[XXX] = XXXX in the middle, all normal

When I am confused and about to go crazy

I remembered, where does PHP save the session?

Tomcat can choose to serialize it in the database, write it to a local file, or simply save it in memory

PHP originally saved it in a txt file by default, and the saved path is session.save_path

in PHP.ini


Amitabha, after upgrading the PHP, the system handed the ownership of session.save_path to root, not the user I currently run PHP

PHP does not have permission to write the session to this path, and of course it will be lost.

FFFFKK Dog Day PHP !!!!

www.bkjia.comtruehttp: //www.bkjia.com/PHPjc/477302.htmlTechArticleI want to upgrade the PHP version for an internal system in the production environment, from 5.3 to 5.4.16. After generating it, I found that I cannot log in. , interrupted the process along the way, and found that when the two pages on the server side jump, it cannot be retrieved...
Statement:
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