Is it possible to read the same cookie from different pages with different domains?

When dealing with cookies in PHP, it is not possible to read the same cookie from different pages with different domains due to the security restrictions imposed by browsers. One way to work around this limitation is to set the cookie domain to a common parent domain that all the pages share. By setting the cookie domain to a common parent domain, the cookie can be accessed by pages under different subdomains.

// Set the cookie with a common parent domain
setcookie("cookie_name", "cookie_value", time() + 3600, "/", ".parentdomain.com");

// Read the cookie from any page under the common parent domain
$cookie_value = $_COOKIE['cookie_name'];