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. An interesting discussion is worth comment. I think that you should write more on this topic, it might not be a taboo subject but generally people are not enough to speak on such topics. To the next. Cheers cara mengobati lutut ngilu

Leave a Reply

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