FrOzeN Posted October 7, 2006 Share Posted October 7, 2006 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? Link to comment https://forums.phpfreaks.com/topic/23254-cookie-forever/ Share on other sites More sharing options...
.josh Posted October 7, 2006 Share Posted October 7, 2006 [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. Link to comment https://forums.phpfreaks.com/topic/23254-cookie-forever/#findComment-105416 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.