Created
September 8, 2021 06:00
-
-
Save vip3r011/22123b43ee30e3ab4496321993aaa8aa to your computer and use it in GitHub Desktop.
phpsessioncleaner.sh
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
#in your php.ini set session.gc_probability = 0 | |
#this disables php GC | |
# put this script via cron | |
# or in /etc/cron.hourly | |
/usr/bin/php -d session.save_path=/var/lib/php/session -d session.gc_probability=1 -d session.gc_divisor=1 -d session.gc_maxlifetime=3600 -r "session_start(); session_destroy();" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment