summaryrefslogtreecommitdiffstats
path: root/system/libraries/Session/drivers
diff options
context:
space:
mode:
authorvlakoff <vlakoff@gmail.com>2013-03-30 00:06:39 +0100
committervlakoff <vlakoff@gmail.com>2013-03-30 00:06:53 +0100
commit0612756dd37a3472259a19814e1a9bb403ab6e11 (patch)
tree6ceebdd906d8b2f41ecc780a219e715d425c05ae /system/libraries/Session/drivers
parentcf58d7ec6ad81f6e67192ed04e816805942aa4f9 (diff)
Some cleanup related to mt_rand()
- min and max values are 0 and mt_getrandmax() by default - remove useless mt_srand() seed calls
Diffstat (limited to 'system/libraries/Session/drivers')
-rw-r--r--system/libraries/Session/drivers/Session_cookie.php3
1 files changed, 1 insertions, 2 deletions
diff --git a/system/libraries/Session/drivers/Session_cookie.php b/system/libraries/Session/drivers/Session_cookie.php
index 0e8644102..7174d63c8 100644
--- a/system/libraries/Session/drivers/Session_cookie.php
+++ b/system/libraries/Session/drivers/Session_cookie.php
@@ -641,7 +641,7 @@ class CI_Session_cookie extends CI_Session_driver {
$new_sessid = '';
do
{
- $new_sessid .= mt_rand(0, mt_getrandmax());
+ $new_sessid .= mt_rand();
}
while (strlen($new_sessid) < 32);
@@ -832,7 +832,6 @@ class CI_Session_cookie extends CI_Session_driver {
$probability = ini_get('session.gc_probability');
$divisor = ini_get('session.gc_divisor');
- srand(time());
if ((mt_rand(0, $divisor) / $divisor) < $probability)
{
$expire = $this->now - $this->sess_expiration;