function session_delete($name) { return Session::delete($name); }
/** * 验证验证码是否正确 * @access public * @param string $code 用户验证码 * @param string $id 验证码标识 * @return bool 用户验证码是否正确 */ public function check($code, $id = '') { $key = $this->authcode($this->seKey) . $id; // 验证码不能为空 $secode = json_decode(Session::get($key), true); if (empty($code) || empty($secode)) { return false; } // session 过期 if (time() - $secode['verify_time'] > $this->expire) { Session::delete($key); return false; } if ($this->authcode(strtoupper($code)) == $secode['verify_code']) { $this->reset && Session::delete($key); return true; } return false; }
public function logout() { Session::delete('id'); return Response::redirect('/'); }