Simply change the expires argument to a date in the past: "username=; expires=Thu, 01 Jan 1970 00:00:00 UTC; path=/;" To guarantee that you delete the correct cookie, you need define the cookie path.
Cookie deletion: To delete a cookie, PHP does not have a specific function. All we have to do now is use the setcookie() function to update the cookie's expire-time value to a previous time. Deducting a few seconds from the current time is an easy approach to do this.
To erase a cookie, set the "expires" date to a date in the past. Your issue is most likely due to the date format not being standard.
very helpful for beginners
Thank you for providing a valuable and well-managed session
Best platform of learning.
Best courses ever.True words