Delete an Array-Style Cookie in PHPDelete each array-style cookie keyExpire each child cookie with the same scope used when it was created. Cookie note: Secure cookies require HTTPS. Choose SameSite and HttpOnly settings according to how the cookie is actually used. Current example first; the detailed tutorial examples below are retained for additional learning and comparison.
Here time() gives us the time elapsed in seconds between current time and Unix Epoch (January 1 1970 00:00:00 GMT). From this value we are subtracting 3600 seconds to give a past time as expire time for the cookie.
Subhendu MohapatraAuthor & Instructor at plus2net I write and maintain practical tutorials on Python, PHP, SQL, JavaScript, HTML, jQuery, and web development at plus2net. The tutorials focus on clear explanations, working examples, and code that readers can test and adapt while learning. Subscribe to our YouTube Channel here
This article is written by plus2net.com team.
https://www.plus2net.com
|