How can cookies be properly deleted in PHP?

To properly delete cookies in PHP, you can set the cookie's expiration time to a past date. This will prompt the browser to remove the cookie from its storage.

// Set the cookie's expiration time to a past date to delete it
setcookie("cookie_name", "", time() - 3600, "/");