I am reading up on clearing cookies. Say a cookie is set with setcookie("abc", "xyz", time()+3600), then from what I’ve read you unset it by using setcookie("abc", "xyz", time()-3600) which sets the cookie to expire in the past. All the examples I’ve seen use this format.
My question is why does the last parameter have to be specifically time()-3600, why can’t it be time()-1 or time()-9999999 for example?
It doesn’t have to be
time() - 3600. That’s merely used in examples because it makes a nice tidy “one hour ago”. It just has to be some time in the past, sotime()-1ortime()-9999999are acceptable as well, as is any value< time().