How can the issue of cookies being deleted after logging out be addressed in PHP?

Issue: Cookies being deleted after logging out can be addressed by setting the cookie expiration time to a past value when the user logs out. This will effectively delete the cookie from the user's browser.

// Code to delete cookie upon logging out
setcookie("user_id", "", time() - 3600, "/");