Jump to content

Archived

This topic is now archived and is closed to further replies.

FrOzeN

Cookie Forever

Recommended Posts

Set cookie (30 days):
[code=php:0]setcookie("name", "value", time() + 60 * 60 * 24 * 30);[/code]


Remove cookie:
[code=php:0]setcookie("name", "", time() - 3600);[/code]


Is there a better way to make a cookie have a "Remember Forever" option?
Also, is there specific way to remove a cookie?, or do you just set it one hour into the past?

Share this post


Link to post
Share on other sites
[b]Is there a better way to make a cookie have a "Remember Forever" option?[/b]
no. all you can do is keep re-setting it. 

[b]Also, is there specific way to remove a cookie?, or do you just set it one hour into the past?[/b]
that is the specific way to remove a cookie. though i would set it for a day or 2 in the past, not just an hour, due to time zone differences.

Share this post


Link to post
Share on other sites

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.