diff options
author | Andrey Andreev <narf@bofh.bg> | 2012-07-02 13:58:54 +0200 |
---|---|---|
committer | Andrey Andreev <narf@bofh.bg> | 2012-07-02 13:58:54 +0200 |
commit | d66872ae5d7cd4d2b531251a9c63528e81af3322 (patch) | |
tree | 4ed76ac11914b22e2aa9d43f65db6f27b1b7bd7a /system/libraries | |
parent | f00b9f02425afc902d79209c108ae74ab73342c9 (diff) | |
parent | fac3761c6a01a12457c61cd4e3b17dba5ee26bf7 (diff) |
Merge branch 'develop' of github.com:EllisLab/CodeIgniter into feature/db_subdrivers
Diffstat (limited to 'system/libraries')
-rw-r--r-- | system/libraries/Session.php | 11 |
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; |