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")));

Written by Tim on October 25th, 2006 with 2 comments.
Read more articles on php.



Related articles

2 comments

Read the comments left by other users below, or:

Trackback Mention from Tutorials.goodfind.org
#1. August 17th, 2007, at 8:11 AM.

Programming Tutorials: Programming Tutorials... I couldn't understand some parts of this article, but it sounds interesting...

Trackback Mention from Gerald.freemedianewsnetwork.info
#2. May 8th, 2008, at 12:13 PM.

c mktime: &quotCookieValue&quot, mktime23, 59, 59, date&quotm&quot, date&quotd&quot, date&quoty&quothttp://www.techtoolblog.com/archives/how-to-expire-a-cookie-at-midnight-using-phpRe: A patch for mktime.c and tz*.c.To: eggerttwinsun.com Paul Eggert Subject: Re: A ...

Leave your comment...

If you want to leave your comment on this article, simply fill out the next form:




You can use these XHTML tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <code> <em> <i> <strike> <strong> .