Copy settings cookies when making a call to other instance

This commit is contained in:
davidovski 2023-08-07 17:01:12 +01:00
parent 7214e4e729
commit 3f2cd3fdb3
2 changed files with 9 additions and 0 deletions

View File

@ -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);

View File

@ -230,4 +230,10 @@
echo "<button type=\"submit\">$text</button>";
echo "</form>";
}
function copy_cookies($curl)
{
curl_setopt( $curl, CURLOPT_COOKIE, $_SERVER['HTTP_COOKIE'] );
}
?>