1. Scenario Description: Please log in again. Later, it was found that the login user information was empty, so the login failure kept appearing. However, the user information was stored in the session, which was stored in the cache before, and the session was changed after the cache could not be written in. It’s always possible to print out the user information before logging in. Session ::set is in session and then session::get is in session. It’s always empty, so check the configuration file to see where the session is stored and in what form. Session is stored in the form of file, which is stored in/TMP or /var/lib/php.session. After checking the storage path, it is found that although the generated session file is always 0K, which means that it has not been written in. There is no problem after checking the permission. Then I checked the disk memory usage of the system and found that the disk memory was full. After that, I cleaned up some early logs, leaving about 10G, but I still couldn’t write them in.

1) Check the disk usage

2) Try to store data in $_SESSION and find that it can be saved

3) Check session:set encapsulated by TP5 framework to see if it is used at the bottom
_ S E S S I O N , the road king: c o r e / l i b r a r y / t h i n k / S e s s i o n . p h p Find the inside of the frame package s e t Method error, scope parameter value changed 86400 , resulting in s e t s e s s i o n Is set to 86400 In the array of, S e s s i o n : : s e t Go is \_SESSION, Lu Jin: Core/library/think/Session. PHP, found that the inside of the frame encapsulation set method out of the question, the scope of the parameter value bai changed to 86400, cause setsession, are set into an array of 86400, the Session: : is set to go
_SESSION, except when we set, the address that we’re writing is\_SESSION\[‘86400’\]\[‘xxxx’\] = ‘xxxx’; At the time of reading_SESSION[‘think’][‘ XXXX ‘]

If it is null, it will default to self:: The prefix, the self: : prefix, the self: : prefix, the self: : prefix is at the time of initialization will be set to config. PHP configuration “think”.

3) The reason why the cache cannot be written is because the redis disk is full. Even after the Redis is restarted, the data cannot be set and the following error will be reported:

“(error) MISCONF Redis is configured to save RDB snapshots, but is currently not able to persist on disk. Commands that may modify the data set are disabled. Please check Redis Logs for details about the error.” .

Config set stop-writes-on-bgsave-error no = config set stop-writes-on-bgsave-error no

The above problems are basically caused by full disk memory. Later, buy a Redis and migrate the cache and session to Redis to avoid problems caused by full disk memory