What steps can be taken to ensure that deleted cookies are not still accessible on subsequent pages in PHP?

When cookies are deleted in PHP using the setcookie() function with an expiration time in the past, they are technically still accessible on subsequent pages until the browser is closed. To ensure that deleted cookies are not still accessible, you can also unset the cookie value in the $_COOKIE superglobal array. This will prevent the deleted cookie from being accessed on subsequent pages.

// Set the cookie with an expiration time in the past to delete it
setcookie('cookie_name', '', time() - 3600);

// Unset the cookie value in the $_COOKIE superglobal array
unset($_COOKIE['cookie_name']);