Home>Article>Backend Development> What should I do if php returns no session?

What should I do if php returns no session?

藏色散人
藏色散人 Original
2021-12-10 10:24:45 1752browse

Solution for php not returning session: 1. Place session_start before themark; 2. Modify the content in php.ini to "session.auto_start =1"; 3. Set session save path.

What should I do if php returns no session?

#The operating environment of this article: Windows 7 system, PHP version 7.4, Dell G3 computer.

What should I do if php returns no session?

A solution to the problem that php cannot obtain the session value:

1. Confirm< ?php session_start();?>Is this sentence before themark? If not, please put it before themark.

2. If after the above operation, "Warning: session_start() [function.session-start" message appears

Solution:

Modify # in php.ini ##session.auto_start = 0issession.auto_start = 1

3. Have you set the session saving path?

You need to modify the session in php.ini .save_path = "C:/TMP" , if the TMP folder does not exist, create it.

Recommended learning: "

PHP Video Tutorial"

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

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