How can the path parameter in the setcookie function affect the availability of a cookie in PHP?

The path parameter in the setcookie function specifies the path on the server where the cookie will be available. If the path is set to "/", the cookie will be available across the entire domain. If a more specific path is set, the cookie will only be available within that path and its subdirectories. To ensure the cookie is available across the entire domain, set the path parameter to "/".

// Set a cookie with a path parameter set to "/"
setcookie("cookie_name", "cookie_value", time() + 3600, "/");