I want to basically stop garbage collector from deleting my php sessions so that I can manually delete them myself under conditions. How would I go about stopping garbage collector?
In the INI set
session.gc_probability = 0
This can also be done with ini_set()
but make sure you do it with every session_start()
call.
Also, it's worth noting that several Linux distros have this as the default and there is a cron job cleaning up expired sessions.