Two days ago to play a little cloud side of the light blog, think things relatively small, they also want to get something, directly put into the server installed, the result AH!!! $_session lost for several days ~
Situation Description:
$_session can only be valid in the current access, and the second request is like the previous www.45it.com Session_destroy ()
Like, the contents of the $_session will be gone, just one
Array ();
;
Here's how I find the target route for this problem:
1. Session_Start (): Think of every visit can be used to write the value of $_session, immediately removed;
2. Session expiration: But found in the code in such a line
| The code is as follows |
|
Ini_set (' Session.gc_maxlifetime ', $lefttime); |
, so it is not the reason;
3. Cookies disabled: View a browser in the storage of cookies, there is nothing to be disabled, the program written in the value, with a print $_cookies are in, also ruled out;
4. speedphp problem: Online search for the relevant keywords also did not find a similar situation, more is said in a write lost a $_session variable, and I this situation is not the same, and then add their own line session_start (); With some other debugging variables and printing, but still no results, also excluded;
5. Help Netizen: Send a request for help information "session can only be valid in the current visit, the second visit feel like the implementation of Session_destroy (), before all content is gone, what is the reason? Ask for ideas ...", ah that is called "Qinhuai Childe (234427967) 20:32:45 disk can not write "back to the fruit of a piece, immediately to/etc open PHP.ini see the session of the storage path, all the way CD in, fast" LL ", AH!!!! There was no language at the time.
| The code is as follows |
|
DRWXRWX---2 root apache xxxx .... |
There was no language at the time.
| The code is as follows |
|
chmod 777 Session |
After the tangle lifted ~
Conclusion: Session is missing, remember to start with directory permissions first