How does the expiration time and path parameter affect the deletion of cookies in PHP?

When setting a cookie in PHP, the expiration time and path parameter determine when and where the cookie will be deleted. If you want the cookie to be deleted when the browser session ends, you can omit the expiration time parameter or set it to 0. The path parameter specifies the path on the server in which the cookie will be available. If you want the cookie to be deleted across all paths, you can set the path parameter to "/".

// Set a cookie with expiration time and path parameter
setcookie("example_cookie", "value", time() + 3600, "/");

// Delete the cookie by setting its expiration time to a past time
setcookie("example_cookie", "", time() - 3600, "/");