I wrote a code using PHP Curl, but for some reason it does not send the cookie needed to log in to the system. I noticed that it only works in firefox version 78. I can't log in because I can't send cookies in new version browsers. What could be the reason?
$MSG = $_GET["MSG"];
$CURL = curl_init();
curl_setopt_array($CURL,
[CURLOPT_URL => "EXAMPLE_URL",
CURLOPT_RETURNTRANSFER => TRUE,
CURLOPT_USERAGENT => $_SERVER["HTTP_USER_AGENT"],
CURLOPT_POST => TRUE,
CURLOPT_POSTFIELDS => $MSG,
CURLOPT_FOLLOWLOCATION => TRUE,
CURLOPT_SSL_VERIFYPEER => FALSE,
CURLOPT_SSL_VERIFYHOST => FALSE,
CURLOPT_COOKIE => "PASSWORD=123456789;secure;HttpOnly;samesite=None",
CURLOPT_HTTPHEADER => array("Content-Type: text/plain;charset=UTF-8"),
CURLOPT_VERBOSE => TRUE]
);
echo curl_exec($CURL);
curl_close($CURL);
I tried to log in by sending the cookie, but it did not detect the cookie. In the 78th version of firefox browser, it sent the cookie successfully and I could log in to the system. I cannot do this in new generation browsers, what is the reason?