summaryrefslogtreecommitdiffstats
path: root/system/libraries
diff options
context:
space:
mode:
Diffstat (limited to 'system/libraries')
-rw-r--r--system/libraries/Session.php11
1 files changed, 4 insertions, 7 deletions
diff --git a/system/libraries/Session.php b/system/libraries/Session.php
index 72a942b8a..af38dc366 100644
--- a/system/libraries/Session.php
+++ b/system/libraries/Session.php
@@ -155,12 +155,6 @@ class CI_Session {
*/
public $time_reference = 'local';
- /**
- * Probablity level of garbage collection of old sessions
- *
- * @var int
- */
- public $gc_probability = 5;
/**
* Session data
@@ -940,8 +934,11 @@ class CI_Session {
return;
}
+ $probability = ini_get('session.gc_probability');
+ $divisor = ini_get('session.gc_divisor');
+
srand(time());
- if ((rand() % 100) < $this->gc_probability)
+ if ((mt_rand(0, $divisor) / $divisor) < $probability)
{
$expire = $this->now - $this->sess_expiration;