Avatar

Session lifetime (General)

by Auge ⌂, Monday, February 03, 2014, 15:21 (3707 days ago) @ Alfie

Hello

<?php
echo '<pre>Session Lifetime:              '. ini_get('session.gc_maxlifetime')."<br />\n";
echo 'Garbage Collector probability: '. ini_get('session.gc_probability')."<br />\n";
echo 'Garbage Collector divisor:     '. ini_get('session.gc_divisor')."</pre>\n";
?>

Nitpicking: you don't need <br> inside of <pre>. ;-)

PHP’s default for the session’s lifetime seems to be 1440 seconds (24 minutes). If you want to change it, locate the line

session_start();

in index.php and add the line

ini_set("session.gc_maxlifetime", "X");

just before, where X is new lifetime in seconds. Untested (I don’t entertain mlf2.x)!

It should, independent from the script version, behave in the same manner.

In my installation I have set it to one hour.

Hui, that's a quite long time.

Tschö, Auge

--
Trenne niemals Müll, denn er hat nur eine Silbe!


Complete thread:

 RSS Feed of thread