The content of this article is to share with you an in-depth introduction to the main session configuration in PHP.ini. It has certain reference value. Friends in need can refer to it
1.session.save_path
This configuration generally refers to the directory where session files are saved. Since I am using the PHPstudy integrated environment, the directory is as shown below.
The function of this configuration item is how to save the session value. The default value is session.save_handler = “files” refers to saving the session value in the form of a file. At the same time, you can also modify the saving method. For example, using “user” refers to the user-defined session storage method.
This configuration item refers to the name of session.name saved in a cookie on the client. Since I am an Apache server, the default is session.name="PHPSESSID";
This configuration item means whether to use cookies on the client to obtain sessionid , the default is session.usecookies=1, which is saved by cookies.
This configuration item means whether to automatically open the session. The default value is session.auto_stat=0, which is not enabled by default.
This configuration item means the life cycle of the session file. The default is session.gc_maxlifetime="1440" , the default is 24 minutes, but it does not mean that the session file will be deleted after 24 minutes. A detailed explanation will be given later.
These two configuration items should be viewed together. The default value is session .gc_probability = 1 and session.gc_pisor = 1000, The meaning of these two configuration items is that after the session file expires, every time someone visits the website again, the probability of the session file being deleted is 1/1000, so it is obvious session.gc_pisor represents the denominator, session.gc_probability represents the numerator.
Summary: The above are almost the commonly used session configuration items in PHP.ini. In addition, it is not difficult to find that the naming of session configuration items is very standardized. If it is two words, it is basically The above is session.xxxxxx. If it is three words, it is basically session.xxxx_xxxxx. In fact, we will find that all configuration items in php.ini are named like this. Knowing this will help us remember these commonly used configuration items.
Related recommendations:
session storage method and configuration
Detailed explanation of express-session configuration items in node.js
php Chinese website learning topic: php session (including pictures, text, Video, case)
The above is the detailed content of An in-depth introduction to the main session configuration in PHP.ini. For more information, please follow other related articles on the PHP Chinese website!