How to save part of SESSION data in PHP The last time someone else gave me a list to save part of SESSION data in PHP, but the problem is that there is always an expiration that cannot be processed, here we will introduce the session expiration settings: In PHP, set php. ini, find the session. gc_maxlifetime = 1440 #(PHP5 is 24 minutes by default) how to save part of SESSION data in PHP
The last time someone gave me a list, I want to save some SESSION data in PHP, but the problem is that there is always an expiration that cannot be processed. here we will introduce the session expiration settings:
In PHP, set php. ini and find session. gc_maxlifetime = 1440 #(PHP5 is 24 minutes by default)
You can set the expiration time as needed, but some people say that it does not work after the setting!
In fact, it is not ineffective, but because the system default:
Session. gc_probability = 1
Session. gc_divisor = 1000
The garbage collection has a probability that 1/1000 means that the session is recycled only once for 1000 times.
As long as your traffic volume is high, the recovery effect can be achieved.
Otherwise, you can set the value of session. gc_divisor,
For example, session. gc_divisor = 1, so that you can see the effect of SESSION expiration)