私はCURLを使用してjson値を取得するために別のドメインにphp経由でリクエストを行いますが、curlが一時セッションを使用することはわかりますが、ここに私のコードが...私はブラウザセッションを維持することができる方法CURLを使用してブラウザセッションを維持するためのクロスドメイン
// create curl resource
$ch = curl_init();
// set url
curl_setopt($ch, CURLOPT_URL, "http://api.json"); //api.json is displaying value from session
//return the transfer as a string
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_COOKIESESSION, true);
// $output contains the output string
$output = curl_exec($ch);
// close curl resource to free up system resources
curl_close($ch);
ある
ブラウザセッションとはどういう意味ですか?このスクリプトを呼び出すときに使用されたセッションですか? –
ええと私はjsonの要求を呼び出すときに私は現在のセッションを持っている必要があります... –