Cookie expiry times are an ABSOLUTE value, based on time since jan 1/1970. You're sending over a relative one: "tomorrow's time minus the current time". This translates into basically the number of seconds left between now and midnight, which is then interpreted as a date back in Jan 1/1970. You don't need to subtract time()
at all:
echo date('r', mktime(24,0,0)), ' ', date('r');
^--note: no subtraction
Tue, 28 Jan 2014 00:00:00 -0600 Mon, 27 Jan 2014 13:30:33 -0600
And poof, you have "tomorrow at midnight", v.s. today's current date/time. So:
setcookie(..., mktime(24,0,0));