Copy settings cookies when making a call to other instance
This commit is contained in:
parent
7214e4e729
commit
3f2cd3fdb3
|
@ -1,4 +1,5 @@
|
|||
<?php
|
||||
|
||||
function get_librex_results($query, $page)
|
||||
{
|
||||
global $config;
|
||||
|
@ -20,8 +21,10 @@
|
|||
|
||||
$librex_ch = curl_init($url);
|
||||
curl_setopt_array($librex_ch, $config->curl_settings);
|
||||
copy_cookies($librex_ch);
|
||||
$response = curl_exec($librex_ch);
|
||||
curl_close($librex_ch);
|
||||
|
||||
$code = curl_getinfo($librex_ch)["http_code"];
|
||||
$results = json_decode($response, true);
|
||||
|
||||
|
|
|
@ -230,4 +230,10 @@
|
|||
echo "<button type=\"submit\">$text</button>";
|
||||
echo "</form>";
|
||||
}
|
||||
|
||||
function copy_cookies($curl)
|
||||
{
|
||||
curl_setopt( $curl, CURLOPT_COOKIE, $_SERVER['HTTP_COOKIE'] );
|
||||
}
|
||||
|
||||
?>
|
||||
|
|
Loading…
Reference in New Issue