What role does the "path" parameter play when setting cookies in PHP, and how can it affect the scope of the cookie?

The "path" parameter in setting cookies in PHP specifies the directory within the server where the cookie will be available. If not specified, the cookie will be available in the directory of the current script. By setting the "path" parameter to "/", the cookie will be available across the entire domain.

// Setting a cookie with a specific path to make it available across the entire domain
setcookie("cookie_name", "cookie_value", time() + 3600, "/");