...
|
...
|
@@ -38,7 +38,7 @@ class Oauth{ |
|
|
// $this->recorder->write('state',$state);
|
|
|
//$_SESSION['qqstate'] = $state;
|
|
|
|
|
|
Session::start('yohobuy_qq_session', null, 'yohobuy.com')->__set('qqstate', $state);
|
|
|
setcookie('_QQ_STATE', $state, 0, '/', '.yohobuy.com');
|
|
|
|
|
|
//-------构造请求参数列表
|
|
|
$keysArr = array(
|
...
|
...
|
@@ -59,8 +59,7 @@ class Oauth{ |
|
|
|
|
|
//--------验证state防止CSRF攻击
|
|
|
// if($_GET['state'] != $state){
|
|
|
$state = Session::start('yohobuy_qq_session', null, 'yohobuy.com')->__get('qqstate');
|
|
|
echo $state, '+++', $_GET['state'];
|
|
|
$state = isset($_COOKIE['_QQ_STATE']) ? $_COOKIE['_QQ_STATE'] : null;
|
|
|
if ($_GET['state'] != $state) {
|
|
|
$this->error->showError("30001");
|
|
|
}
|
...
|
...
|
|