View Full Version : setcooking(), expires never - how?
09-28-2006, 01:29 PM
How would you make cookies to never expire? If you set it to 0 it will destroy after the session is gone. And negative values don't work?
setcookie ("TestCookie", "", time() + 60*60*24*365*100);
will make the cookie expire after 100 years.
09-28-2006, 02:26 PM
I set my cookie to expire in one year. Thanks for reply, I were looking for unlimited expiration, but seems it's impossible. Anyways, most browsers would have deleted the old cookies anyway...
"unlimited expiration" as such is, afaik, not possible and probably not usefull. but you can achieve the same by setting the expirationdate unrealistically far in the future.
09-28-2006, 03:29 PM
There is no guarantee that the cookie won't expire after the user ends his session. He may have just set them to expire anyway (usefull for public computers).
09-29-2006, 10:26 AM
reguler cookie deleters do exist :P
09-29-2006, 11:40 AM
You can check if an user accepts cookies by checking if it's set on the next page. You just have no guarantee that they will be set as long as you want.
i think this thread is getting a bit silly.
the answer to the original question is long reached --> you can only set the expiredate way in the future.
09-29-2006, 11:54 AM
You're right. No reason I should care if nobody else does.
Powered by vBulletin® Version 4.2.2 Copyright © 2015 vBulletin Solutions, Inc. All rights reserved.