summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTyler Brownell <tyler@bluefoxstudio.ca>2013-12-13 06:23:12 +0100
committerTyler Brownell <tyler@bluefoxstudio.ca>2013-12-13 06:23:12 +0100
commit74c5f2668d31f7384ea5f014014356144059cbf3 (patch)
tree99e39f5770a7011c46912a645fd04e66178b77b2
parent530a3daec00186562e7e081ba77173b5ad065935 (diff)
Issue #2763 - Fixes Session GC Probability Calculation
This should resolve issue #2763 where the cookie session garbage collection was running every request.
-rw-r--r--system/libraries/Session/drivers/Session_cookie.php2
1 files changed, 1 insertions, 1 deletions
diff --git a/system/libraries/Session/drivers/Session_cookie.php b/system/libraries/Session/drivers/Session_cookie.php
index d3d22d03a..cd8074474 100644
--- a/system/libraries/Session/drivers/Session_cookie.php
+++ b/system/libraries/Session/drivers/Session_cookie.php
@@ -841,7 +841,7 @@ class CI_Session_cookie extends CI_Session_driver {
$probability = ini_get('session.gc_probability');
$divisor = ini_get('session.gc_divisor');
- if ((mt_rand(0, $divisor) / $divisor) < $probability)
+ if (mt_rand(1, $divisor) <= $probability)
{
$expire = $this->now - $this->sess_expiration;
$this->CI->db->delete($this->sess_table_name, 'last_activity < '.$expire);