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

What should I do if php returns no session?

藏色散人
Release: 2023-03-14 12:06:01
Original
1853 people have browsed it

Solution for php not returning session: 1. Place session_start before the mark; 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 the mark? If not, please put it before the mark.

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

Solution:

Modify # in php.ini ##session.auto_start = 0 is session.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!

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