Happen to be tugging out my hair attempting to discover why my periods are now being ended/wiped out/destroyed at half an hour. Well it appears like Debian based systems possess a special cron running that ignores all php.ini and apache designs and kills any idle session at half an hour.

The cron path: /etc/cron.d/php5

Within the cron:

# /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 minutes
09,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

I am pretty good at setting up and establishing hosts but I am no sysAdmin. Could someone help me override/edit/change/reconfigure this in order to set the worthiness longer? I believe 3 hrs could be nice but I must comprehend the changes therefore if someone greater up really wants to result in the session time shorter/longer I disadvantage document how you can configure the modification.

Because of any insight help about this

EDIT: Adding /usr/lib/php5/maxlifetime code

#!/bin/sh -e

max=1440

for 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=$cur
done

echo $(($max/60))

exit 0

therefore it looks to become searching all of the php.ini files, finds the finest value, compares it to 1440 (that is 24 minutes).

Listed here are the php.ini files

/etc/php5/apache2/php.ini
session.gc_maxlifetime = 1440 

/etc/php5/cgi/php.ini
session.gc_maxlifetime = 1440

/etc/php5/cli/php.ini
session.gc_maxlifetime = 1440

why does my script session get wiped out at half an hour and never 24 minutes?

EDIT #2: CRON running every half an hour is the reason why the session looks to become wiped out at half hour times. However it may be 24 to 54 minutes, FYI

Also overlooking the code in: /usr/lib/php5/maxlifetime it's using the greatest value and throughout my testing I had been attempting to lower the threshold to accelerate the problem.

Appears like I simply need to increase one around the php.ini files to in excess of 1 hour test test.

Edit the file /usr/lib/php5/maxlifetime

The worthiness ought to be within minutes. This file will really also look at your php.ini so I'm not sure why it had not been on your side.

This can be a question for serverfault.com.

However, change session.gc_maxlifetime in /etc/php5/apache2/php.ini or - without having an apache2 one - among the other /etc/php5/*/php.ini files. The script /usr/lib/php5/maxlifetime will make use of the maximum for your setting present in any one of individuals files.

Editing maxlifetime will not help or at best only before the php5-common package is up-to-date again.