summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndrey Andreev <narf@devilix.net>2013-12-13 15:25:00 +0100
committerAndrey Andreev <narf@devilix.net>2013-12-13 15:25:00 +0100
commit37fe56fe9442e728893f6cc2a8cc4cfabf9f14c9 (patch)
tree89f2471426ae2a4bd5c0552d4367a4f173dc0051
parentf8f14f3da263338bb4723012229f6c373a1764c6 (diff)
parent74c5f2668d31f7384ea5f014014356144059cbf3 (diff)
Merge pull request #2764 from refringe/feature/cookie_session
Issue #2763 - Fixes Session GC Probability Calculation
-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);