What is the correct way to delete a cookie in PHP?

When you want to delete a cookie in PHP, you need to set the cookie's expiration time to a past time, which effectively removes the cookie from the browser. This can be done by using the setcookie() function with a past expiration time.

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