• Plesk Uservoice will be deprecated by October. Moving forward, all product feature requests and improvement suggestions will be managed through our new platform Plesk Productboard.
    To continue sharing your ideas and feedback, please visit features.plesk.com

Session Problem with session.gc_maxlifetime = 7200

MaurizioN

New Pleskian
Hello my english is not so good, but i have a big problem.
In the PHP-settings of Plesk 12 for my domain i have this:

session.gc_maxlifetime = 7200

with phpinfo() its show me the same settings.

Now the problem:
in the folder /var/lib/php5 the sesscion are killed after i think 30-40 minutes.

I dont know which script is responsible for this trouble.

Pleas help me...
 
I resolved the problem by my self:

Hiere the way:

One thing you might not have noticed is that in the Debian/Ubuntu distro, by default PHP disables its session garbage collection mechanism

(eg. the default php.ini contains the line ;session.gc_probability = 0in Ubuntu).

Instead, it runs a cron job every half hour (see the script /etc/cron.d/php5) to purge session files in the /var/lib/php5/ directory. In most cases, this doesn't do the session cleanup job for us as session data may not be saved in files under the /var/lib/php5/ directory (like in Drupal). Thus by default PHP session garbage collection does not run in Debian/Ubuntu as many may expect. To solve this, you can modify the php.ini file by adding the line

session.gc_probability = 1

there. In Drupal, you can also change the settings.php file and add lines such as:

ini_set('session.gc_probability', 1); ini_set('session.gc_divisor', 100);

In addition, then the cron job needs to be disabled . Simply /etc/cron.d/php5 edit with the editor of your choice and comment out the last line :

- See more at: https://www.appnovation.com/blog/session-garbage-collection-php#sthash.e4zh2Lvd.dpuf
 
Back
Top