Php CURL cookie with 24-hour session

I have a curl script that takes data from my personal account on another site, the problem is that the script works only 24 hours (the session on the site is set to 24 hours), when 24 hours pass my script no longer works and I get a response that the session is out of date. how do I update the session in curl every 24 hours?


$ch = curl_init();
$post_field = 'ajax=SearchArticulo&cntrSgn=DeExMEkRabGEO396gOLDMqUZiXe2BibRjqgUXwZlQmMgrw4jJmdAwbUD11%2BddBhn&srcInicio=false&isSimple=false&codMarca=0&field=nombre&value=&oferta=false&pvpSubido=False&detallada=false&codPedido=';
$post_field .= '&cat1=5&cat2=65&cat3=363&token=';
curl_setopt($ch, CURLOPT_URL, 'https://E8029:[email protected]/WebForms/Clientes/GenerarPedidosVentas_new.aspx');
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, $post_field);
curl_setopt($ch, CURLOPT_USERAGENT, 'User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/123.0.0.0 Safari/537.36');
curl_setopt ($ch, CURLOPT_REFERER, 'https://E8029:[email protected]/WebForms/Clientes/GenerarPedidosVentas_new.aspx');
curl_setopt($ch, CURLOPT_COOKIEJAR, $_SERVER['DOCUMENT_ROOT'].'/modules/heallyimport/cookie_actibios.txt');
curl_setopt($ch, CURLOPT_COOKIEFILE, $_SERVER['DOCUMENT_ROOT'].'/modules/heallyimport/cookie_actibios.txt');
curl_setopt($ch, CURLOPT_VERBOSE, true);
    curl_setopt($ch, CURLOPT_COOKIESESSION, false);
curl_setopt($ch, CURLOPT_HTTPHEADER, array(
    'Connection: Keep-Alive'
));
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, false);
$result = curl_exec($ch);
if (curl_errno($ch)) {
    echo 'Error:' . curl_error($ch);
}
$dom = new DOMDocument();
$dom->loadHTML($result);
$tables = $dom->getElementsByTagName('table');
$table_array = array();
foreach ($tables as $table) {
    $rows = $table->getElementsByTagName('tr');
    foreach ($rows as $row) {
        $cols = $row->getElementsByTagName('td');
        $row_array = array();
        foreach ($cols as $col) {

            $row_array[] = $col->nodeValue;
        }
        $table_array[] = $row_array;
    }
}

$products = [];
foreach ($table_array as &$item) {

    curl_setopt($ch, CURLOPT_URL, 'https://E8029:[email protected]/WebForms/Clientes/Indicacion.aspx?cp='.$item[0]);
    curl_setopt($ch, CURLOPT_POSTFIELDS, "ajax=GetIndicacion&codArticulo=".$item[0]);
    curl_setopt($ch, CURLOPT_COOKIEJAR, $_SERVER['DOCUMENT_ROOT'].'/modules/heallyimport/cookie_actibios.txt');
    curl_setopt($ch, CURLOPT_COOKIEFILE, $_SERVER['DOCUMENT_ROOT'].'/modules/heallyimport/cookie_actibios.txt');
    curl_setopt ($ch, CURLOPT_REFERER, 'https://E8029:[email protected]/WebForms/Clientes/GenerarPedidosVentas_new.aspx');
    curl_setopt($ch, CURLOPT_VERBOSE, true);
    curl_setopt($ch, CURLOPT_COOKIESESSION, false);
    $page_content = preg_replace('/<(pre)(?:(?!</1).)*?</1>/s','',curl_exec($ch));
    $desc = explode(':',$page_content);

    $description = str_replace(",'marca'","",$desc[3]);
    $description = str_replace("'", "", $description);
    $name = str_replace("xc2xa0",' ',$item[1]);
    $name = trim($name);

    $products[] = [
        'ref' => $item[0],
        'name' => $name,
        'cat1' => 'COSMÉTICA E HIGIENE',
        'cat2' => 'Salud bucodental',
        'cat3' => 'Hilo dental e interdentales',
        'image' => 'https://E8029:[email protected]/WebForms/Controls/imgArticulo.aspx?ca='.$item[0],
        'stock' => $item[5],
        'desc' => $description,
        'brand' => $item[2],
        'price1' => floatval($item[6]),
        'price2' => floatval($item[7])
    ];
    unset($item[8]);
    unset($item[9]);
    unset($item[10]);
}
echo json_encode($products); ```