Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/php/291.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
使用php和curl登录google voice时出现cookie问题?_Php_Curl - Fatal编程技术网

使用php和curl登录google voice时出现cookie问题?

使用php和curl登录google voice时出现cookie问题?,php,curl,Php,Curl,我试图登录到谷歌语音使用卷曲和谷歌语音类在,发送短信 我收到以下错误:“浏览器的cookie功能已关闭。请打开它。[?]” 登录期间问题的根源在于以下代码: curl_setopt($this->_ch, CURLOPT_URL, 'https://www.google.com/accounts/ServiceLoginAuth?service=grandcentral'); curl_setopt($this->_ch, CURLOPT_POST, TRUE);

我试图登录到谷歌语音使用卷曲和谷歌语音类在,发送短信

我收到以下错误:“浏览器的cookie功能已关闭。请打开它。[?]”

登录期间问题的根源在于以下代码:

    curl_setopt($this->_ch, CURLOPT_URL, 'https://www.google.com/accounts/ServiceLoginAuth?service=grandcentral');
    curl_setopt($this->_ch, CURLOPT_POST, TRUE);
            curl_setopt($this->_ch, CURLOPT_COOKIEFILE, $this->_cookieFile);
    curl_setopt($this->_ch, CURLOPT_POSTFIELDS, array(
        'Email' => $this->_login,
        'Passwd' => $this->_pass,
        'continue' => 'https://www.google.com/voice/account/signin',
        'service' => 'grandcentral',
        'GALX' => $GALX
        ));

    $html = curl_exec($this->_ch);
谁能告诉我该怎么办

提前感谢,


KC

我也有同样的问题。你在启用cookie的情况下执行Get请求。在发布时也使用该cookie。它工作正常。

如果你也将
CURLOPT_COOKIEJAR
定义为同一个文件,会发生什么?感谢你查看它Wrikken,我添加了'curl_setopt($this->ch,CURLOPT_COOKIEJAR,$this->\u cookieFile)`,但一切都没有改变。我仍然得到相同的错误,嗯,你肯定在使用同一个类的实例?您是否可以检查/提供(匿名)请求和响应头?请求头:字符串'POST/accounts/ServiceLoginAuth?service=grandcentral HTTP/1.1用户代理:Mozilla/4.0(兼容;MSIE 7.0;Windows NT 6.0)主机:www.google.com Accept:/Cookie:GAPS=1:gBWsvwHhkE4b0AtyVuLjgtQBtW6ISQ:AG59bxV-tUeFug5t内容长度:627预期:100继续内容类型:多部分/表单数据;boundary=----------------------------b658d42214be'(长度=357)响应头:HTMLHTTP/1.1200OK内容类型:text/html;charset=UTF-8 Set Cookie:GAPS=1:xdkKXeIlul2f9b7Mi-zKQwdnsOn3RA:8kIbvQ3C3_Ks52dV;路径=/帐户;Expires=太阳,2014年1月12日03:51:58 GMT;保护HttpOnly日期:2012年1月13日星期五03:51:58 GMT过期时间:2012年1月13日星期五03:51:58 GMT缓存控制:专用,最大年龄=0 X-Content-Type-Options:nosniff X-XSS-Protection:1;模式=块内容长度:1886服务器:GSE