How to Expire a Cookie at Midnight using PHP

One line of code:

setcookie("CookieName", "CookieValue", mktime(23, 59, 59, date("m"), date("d"), date("y")));

Tim

A .NET, PHP, Marketing Guru authority, at least I hope I am. Reach me at tboland@gmail.com

121 thoughts on “How to Expire a Cookie at Midnight using PHP

  1. The article you have shared here very awesome. I really like and appreciated your work. I read deeply your article, the points you have mentioned in this article are useful
    run 2

Leave a Reply

Your email address will not be published. Required fields are marked *