Ec (2); & nbsp; session_start (). I have spent four days solving this problem. in fact, there are a lot of solutions on the Internet, and many people in the Forum can answer such questions. But in the end, I still run the php code on my friend's computer. After confirming that there is no error, and then through a friend's php. ini to compare, find out the different places, and then the modification is successful. the current situation is that there are still Warning Warnings: Warning: session_start () [fu script ec (2); script
Session_start (), which has been solved for four days. in fact, there are a lot of solutions on the Internet, and many people in the Forum can answer such questions. But in the end, I still run the php code on my friend's computer. After confirming that there is no error, and then through a friend's php. ini to compare, find out the different places, and then the modification is successful. the current situation is that there is still a Warning that the Warning is: session_start () [function. session-start]: Cannot send session cookie-headers already sent in C: phpphpdesigner_output_tmp.php on line 2. However, the code can run successfully and the value of $ _ SESSION can be passed to other pages, then I will not modify other items (the items that have not been compared ). the last sigh is that it is difficult for a person to write a program based on interest!
Now let's talk about my own problems. When I find session_start () on the Internet, some posts mentioned that I want to modify session. save_path = c: mp and session. cookie_path =/
The two paths are c: mp and then a folder is added. however, the problem is that session. the value of cookie_path should be =/I am ashamed that I still don't understand what the value is.
In fact, the session_start () issue still needs to be resolved. put_buffery = on or modified to 4096 or session_start () followed by ob_start (); cache-limiter =; null, and whether apache cache is enabled, but it does not help me. the following is a summary of some questions about session_start () that I found when I found the answer to the question. I would like to summarize it myself. Now I will post this brother's article.
Session highlights
For the PHP session function, there is always no suitable answer, especially some errors, and there are some no error results. The most terrible thing is the latter, which has always been difficult for many beginners. Some veterans are sometimes confused. This article provides a brief summary of these issues for your reference.
1.
Error Message
Warning: Cannot send session cookie-headers already sent
Warning: Cannot send session cache limiter-headers already sent
Analysis and Solutions
The reason for this problem is that when you use session_start () in the program, the actual html content is output. Maybe you said, I didn't. I just echo or print a message. Sorry, the output produced by your echo or print statement is the actual html content output. The solution to this problem is to tune your session_start () to the first line of the program.
2.
Error Message
Warning: open (F:/689phpsessiondatasess_66a39376b873f4daecf239891edc98b5, O_RDWR) failed
Analysis and Solution
This error occurs generally because the session. save_path item in your php. ini is not set. The solution is to set session. save_path and session. cookie_path
Session_save_path = c: emp
Session. cookie_path = c: emp
Create a temp directory under the c: directory.
3.
Error Message
Warning: Trying to destroy uninitialized session in
Analysis and Solution
Generally, you directly call the session_destroy () function. Many friends think that the session_destroy () function can run independently, but it is not. The solution is to enable the session function with session_start () before you call the session_destroy () function.
4. Question: How can I obtain the id of the current session?
The simplest method is:
Echo SID;
You will find.