summaryrefslogtreecommitdiffstats
path: root/system/libraries/Session.php
diff options
context:
space:
mode:
authorAndrey Andreev <narf@bofh.bg>2012-07-02 13:58:54 +0200
committerAndrey Andreev <narf@bofh.bg>2012-07-02 13:58:54 +0200
commitd66872ae5d7cd4d2b531251a9c63528e81af3322 (patch)
tree4ed76ac11914b22e2aa9d43f65db6f27b1b7bd7a /system/libraries/Session.php
parentf00b9f02425afc902d79209c108ae74ab73342c9 (diff)
parentfac3761c6a01a12457c61cd4e3b17dba5ee26bf7 (diff)
Merge branch 'develop' of github.com:EllisLab/CodeIgniter into feature/db_subdrivers
Diffstat (limited to 'system/libraries/Session.php')
-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;