How can cookies be set to be accessible across different windows or frames in PHP?

To set cookies to be accessible across different windows or frames in PHP, you can specify the domain parameter when setting the cookie. By setting the domain to a common parent domain of the windows or frames, the cookie will be accessible across them.

setcookie('cookie_name', 'cookie_value', time() + 3600, '/', '.example.com');