Summary of invalid PHP Session loss

Source: Internet
Author: User
Tags php session

Two days ago, I played a light blog on the cloud side. I felt that something was relatively small and I wanted to get something, so I put it directly into the server. The result is !!! $ _ SESSION has been lost for several days ~

$ _ SESSION can only be valid for the current access. The second request is like executing <per> session_destroy () </per>.

Similarly, the content in $ _ SESSION will be gone.

Array ();

The following is my search target route for this problem:
1. session_start (): think that $ _ SESSION can be used to write the value stored in each access, and it will be immediately removed;
2. session expiration: However, this line is found in the code.

The code is as follows: Copy code

Ini_set ('session. Gc_maxlifetime', $ lefttime );

, So this is not the reason;
3. cookie disabled: check the storage of COOKIES in a browser, and nothing is disabled. The values written in the program are printed $ _ and all COOKIES are excluded;
4. speedphp problems: no similar situations have been found when the related keywords are searched on the internet. Most of the problems are that a $ _ SESSION variable is lost in one write, this is not the case with me. Then, I added session_start (); some other debugging variables and printing, but there was still no result, and I also ruled out it;
5. "session is only valid for the current access. The second access is like executing session_destroy (). No content is available, what are the causes? Thinking ...", Ah, that is "Qinhuai District (234427967) 20:32:45 the disk can not be written" back to the result, immediately go to/etc to open php. ini looks at the session storage path and cd all the way in. The speed is "ll", Ah !!!! It was speechless.

The code is as follows: Copy code

Drwxrwx --- 2 root apache xxxx ....

There was no language at that time.

The code is as follows: Copy code

Chmod 777 session

After, tangle removed ~
Conclusion: The SESSION is lost. Remember to start with the directory permission first.

Related Article

E-Commerce Solutions

Leverage the same tools powering the Alibaba Ecosystem

Learn more >

Apsara Conference 2019

The Rise of Data Intelligence, September 25th - 27th, Hangzhou, China

Learn more >

Alibaba Cloud Free Trial

Learn and experience the power of Alibaba Cloud with a free trial worth $300-1200 USD

Learn more >

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: and provide relevant evidence. A staff member will contact you within 5 working days.