<?php
$sessionId = '2454bb7293c234332f25b39830387bf0'; // Retrieve this from the browser's cookies or another source
//$client = new \GuzzleHttp\Client();
//$response = $client->request('GET', 'https://l...content-available-to-author-only...l.test/guestcart/index/index', [
//'headers' => [
//'Cookie' => 'PHPSESSID=' . $sessionId
//]
//]);
//$sessionValue = (string) $response->getBody();
//echo $sessionValue;
// Initialize cURL session
// Set the URL of the Magento endpoint
curl_setopt($ch, CURLOPT_URL
, "https://l...content-available-to-author-only...l.test/guestcart/index/index");
// Set cURL options
'Cookie: PHPSESSID=' . $sessionId
]);
// Execute the request
// Check for errors
} else {
// Output the response
echo 'Session value: ' . $response;
}
// Close cURL session
?>
PD9waHAKICBzZXNzaW9uX3N0YXJ0KCk7CiAgJHNlc3Npb25JZCA9ICcyNDU0YmI3MjkzYzIzNDMzMmYyNWIzOTgzMDM4N2JmMCc7IC8vIFJldHJpZXZlIHRoaXMgZnJvbSB0aGUgYnJvd3NlcidzIGNvb2tpZXMgb3IgYW5vdGhlciBzb3VyY2UKICAvLyRjbGllbnQgPSBuZXcgXEd1enpsZUh0dHBcQ2xpZW50KCk7CiAgLy8kcmVzcG9uc2UgPSAkY2xpZW50LT5yZXF1ZXN0KCdHRVQnLCAnaHR0cHM6Ly9sLi4uY29udGVudC1hdmFpbGFibGUtdG8tYXV0aG9yLW9ubHkuLi5sLnRlc3QvZ3Vlc3RjYXJ0L2luZGV4L2luZGV4JywgWwogICAgLy8naGVhZGVycycgPT4gWwogICAgICAvLydDb29raWUnID0+ICdQSFBTRVNTSUQ9JyAuICRzZXNzaW9uSWQKICAgIC8vXQogIC8vXSk7CiAgLy8kc2Vzc2lvblZhbHVlID0gKHN0cmluZykgJHJlc3BvbnNlLT5nZXRCb2R5KCk7CiAgLy9lY2hvICRzZXNzaW9uVmFsdWU7Ci8vIEluaXRpYWxpemUgY1VSTCBzZXNzaW9uCiRjaCA9IGN1cmxfaW5pdCgpOwoKLy8gU2V0IHRoZSBVUkwgb2YgdGhlIE1hZ2VudG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