我有一个PHP应用程序,我正在尝试与GitHub集成。从身份验证中获取代码后,我尝试用access_token交换它,我收到以下错误
Cookies must be enabled to use GitHub.
我正在使用cURL库来执行我的请求。我设置的标题是
可以帮我解决这个问题吗?
答案 0 :(得分:1)
使用
/* cURL will start a new cookie session and ignore any previous cookies */
curl_setopt($ch, CURLOPT_COOKIESESSION, true);
/* this is the name of the file where cURL should save cookie information */
curl_setopt($ch, CURLOPT_COOKIEJAR, 'cookie.txt');
// could be empty, but cause problems on some hosts