How can PHP sessions be extended to have access across an entire domain for easier transfer?

PHP sessions can be extended to have access across an entire domain by setting the session cookie domain to the root domain using the `session_set_cookie_params` function. This allows the session data to be shared across subdomains and paths within the same domain, making it easier to transfer data between different parts of the website.

// Set the session cookie domain to the root domain
session_set_cookie_params(0, '/', '.example.com');
session_start();