Debian based systems Session killed at 30 minutes in special cron, how to override?

agor

New Member
Have been pulling out my hair trying to find out why my sessions are being terminated/killed/destroyed at 30 minutes. Well it looks like Debian based systems have a special cron running that ignores all php.ini and apache configurations and kills any idle session at 30 minutes. The cron path: \[code\]/etc/cron.d/php5\[/code\]Inside the cron:\[code\]# /etc/cron.d/php5: crontab fragment for php5# This purges session files older than X, where X is defined in seconds# as the largest value of session.gc_maxlifetime from all your php.ini# files, or 24 minutes if not defined. See /usr/lib/php5/maxlifetime# Look for and purge old sessions every 30 minutes09,39 * * * * root [ -x /usr/lib/php5/maxlifetime ] && [ -d /var/lib/php5 ] && find /var/lib/php5/ -type f -cmin +$(/usr/lib/php5/maxlifetime) -print0 | xargs -n 200 -r -0 rm\[/code\]I'm not bad at configuring and setting up hosts but I'm no sysAdmin. Could someone please help me override/edit/change/reconfigure this so I can set the value longer? I think 3 hours would be nice but I would like to understand the changes so if someone higher up wants to make the session time shorter/longer I con document how to configure the change.Thanks to any insight help on thisEDIT:Adding /usr/lib/php5/maxlifetime code\[code\]#!/bin/sh -emax=1440for ini in /etc/php5/*/php.ini; do cur=$(sed -n -e 's/^[[:space:]]*session.gc_maxlifetime[[:space:]]*=[[:space:]]*\([0-9]\+\).*$/\1/p' $ini 2>/dev/null || true); [ -z "$cur" ] && cur=0 [ "$cur" -gt "$max" ] && max=$curdoneecho $(($max/60))exit 0\[/code\]so it looks to be searching all the php.ini files, finds the greatest value, compares it to 1440 (which is 24 minutes).Here are the php.ini files\[code\]/etc/php5/apache2/php.inisession.gc_maxlifetime = 1440 /etc/php5/cgi/php.inisession.gc_maxlifetime = 1440/etc/php5/cli/php.inisession.gc_maxlifetime = 1440\[/code\]but why does my script session get killed at 30 minutes and not 24 minutes?EDIT #2:CRON running every 30 minutes is why the session looks to be killed at 30 minute intervals.But it could also be 24 to 54 minutes, FYIAlso looking over the code in: \[code\]/usr/lib/php5/maxlifetime\[/code\] it's taking the highest value and during my testing I was trying to lower the threshold to speed up the condition.Looks like I just need to increase one on the php.ini files to over one hour test test.
 
Back
Top