Support ⇒ Explain Please ⇒ Deleting Sessons files ⇒ Community Forums ⇒ CPG Dragonfly™ CMS
Forum IndexExplain Please

Deleting Sessons files Reply to topic


i have a folder /tmp which stores the session files, the problem is it keeps storing them until i hit the max file limit them the site doesn't work properly.

Is there a code i can add to delete them?

Server specs (Server OS / Apache / MySQL / PHP / DragonflyCMS):
Litespeed/Apache2.4.23/MySQL5.5.42/PHP 5.6.25/DF 9.4.0.0


What are the php values for:
  • session.gc_probability
  • session.gc_divisor
  • session.gc_maxlifetime

Server specs (Server OS / Apache / MySQL / PHP / DragonflyCMS):
Fedora 25 / Apache 2.4.27 / MariaDB 10.1.26 / PHP 7.1.10 / Mercurial


DJ Maze wrote
What are the php values for:
  • session.gc_probability
  • session.gc_divisor
  • session.gc_maxlifetime


i don't know the values, cant find anything iin the shared hosted cloud cpanel
I let this post go for a few months to confirm none of the sessions have been deleted

Server specs (Server OS / Apache / MySQL / PHP / DragonflyCMS):
Litespeed/Apache2.4.23/MySQL5.5.42/PHP 5.6.25/DF 9.4.0.0


You could create a php script to read those values.
Something like this:
<?php echo 'session.gc_probability = ' . ini_get('session.gc_probability') . "\n"; echo 'session.gc_divisor = ' . ini_get('session.gc_divisor') . "\n"; echo 'session.gc_maxlifetime = ' . ini_get('session.gc_maxlifetime') . "\n"; ?>

Server specs (Server OS / Apache / MySQL / PHP / DragonflyCMS):


thanks i tried this and got
session.gc_probability = 1 session.gc_divisor = 100000 session.gc_maxlifetime = 1440

Server specs (Server OS / Apache / MySQL / PHP / DragonflyCMS):
Litespeed/Apache2.4.23/MySQL5.5.42/PHP 5.6.25/DF 9.4.0.0


BobCat wrote
session.gc_probability = 1 session.gc_divisor = 100000 session.gc_maxlifetime = 1440


Is this good or bad lol
Is there a script i could use to delete the session files after a certain period?

my site has a limit of 89,000 files, after i hit that the site locks up and cant create cookies along with other problems.
It takes about 3mths to block up, atm i delete the temp folder once a month when i think of it.

Server specs (Server OS / Apache / MySQL / PHP / DragonflyCMS):
Litespeed/Apache2.4.23/MySQL5.5.42/PHP 5.6.25/DF 9.4.0.0


It's bad. Set the gc_divisor lower.
In your config.php
ini_set('session.gc_divisor', 100);

Server specs (Server OS / Apache / MySQL / PHP / DragonflyCMS):
Fedora 25 / Apache 2.4.27 / MariaDB 10.1.26 / PHP 7.1.10 / Mercurial

Last edited by DJ Maze on Thu Jul 30, 2015 11:03 pm; edited 1 time in total


TY

Server specs (Server OS / Apache / MySQL / PHP / DragonflyCMS):
Litespeed/Apache2.4.23/MySQL5.5.42/PHP 5.6.25/DF 9.4.0.0

All times are UTC


Jump to: