Answer the question
In order to leave comments, you need to log in
Why does the site not provide the necessary cookies?
I went into inspector mode, made copy as cURL through the site and generated a curl request.
curl_setopt($ch, CURLOPT_URL, 'myURL');
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'GET');
curl_setopt($ch, CURLOPT_ENCODING, 'gzip, deflate');
curl_setopt($ch, CURLOPT_COOKIEFILE, $cookiefile);
curl_setopt($ch, CURLOPT_COOKIEJAR, $cookiefile);
200
, everything seems to be fine, but at the same time in the browser the answer is - Status Code: 304 Not Modified
ak_bmsc
and akacd_activate_*****_com_phased_release
akacd_activate_*****_com_phased_release
and bm_sz
and _abck
, i.e. the site does not give me cookies that we see in the browser, but gives some others. Answer the question
In order to leave comments, you need to log in
The "HTTP 304 Not Modified" client code indicates that it is not necessary to resubmit the requested resources. This is an implicit redirect to a cached resource.
clipping from MDN - 304 Not Modified
Perhaps your server reacts differently to requests from the user (User-Agent) and from a third-party server (Host)
The site gives 2 cookies that I need: ak_bmsc and akacd_activate_*****_com_phased_release
Now I make a cURL request and I get cookies:
akacd_activate_*****_com_phased_release and bm_sz and _abck, i.e. the site does not give me cookies that we see in the browser, but gives some others.
curl_setopt_array($ch, [
CURLOPT_URL, 'myURL',
CURLOPT_RETURNTRANSFER, true,
CURLOPT_FOLLOWLOCATION, true,
CURLOPT_ENCODING, 'gzip, deflate',
CURLOPT_COOKIEFILE, $cookiefile,
CURLOPT_COOKIEJAR, $cookiefile,
CURLOPT_USERAGENT, '' // Впишите сюда User-Agent из вашего браузера
]);
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'GET');
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question