From 0c55455df26a1626a60d0dc35d2d89002b741d44 Mon Sep 17 00:00:00 2001 From: yunwuxin <448901948@qq.com> Date: Wed, 6 Jul 2016 09:47:11 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=AD=A3session=E5=89=8D=E7=BC=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/Captcha.php | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/Captcha.php b/src/Captcha.php index 5aeb60a..a09a86c 100644 --- a/src/Captcha.php +++ b/src/Captcha.php @@ -108,18 +108,18 @@ public function check($code, $id = '') { $key = $this->authcode($this->seKey) . $id; // 验证码不能为空 - $secode = Session::get($key); + $secode = Session::get($key, ''); if (empty($code) || empty($secode)) { return false; } // session 过期 if (time() - $secode['verify_time'] > $this->expire) { - Session::delete($key); + Session::delete($key, ''); return false; } if ($this->authcode(strtoupper($code)) == $secode['verify_code']) { - $this->reset && Session::delete($key); + $this->reset && Session::delete($key, ''); return true; } @@ -198,8 +198,8 @@ public function entry($id = '') $secode = []; $secode['verify_code'] = $code; // 把校验码保存到session $secode['verify_time'] = time(); // 验证码创建时间 - Session::set($key . $id, $secode); - + Session::set($key . $id, $secode, ''); + ob_start(); // 输出图像 imagepng($this->_image);