Skip to content

Instantly share code, notes, and snippets.

@vip3r011
Created September 8, 2021 06:00
Show Gist options
  • Save vip3r011/22123b43ee30e3ab4496321993aaa8aa to your computer and use it in GitHub Desktop.
Save vip3r011/22123b43ee30e3ab4496321993aaa8aa to your computer and use it in GitHub Desktop.
phpsessioncleaner.sh
#!/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