Devine Posted July 30, 2007 Share Posted July 30, 2007 "Forever" cookies.. How can I do that? Link to comment https://forums.phpfreaks.com/topic/62411-solved-cookies/ Share on other sites More sharing options...
ChadNomad Posted July 30, 2007 Share Posted July 30, 2007 What's the point? Link to comment https://forums.phpfreaks.com/topic/62411-solved-cookies/#findComment-310636 Share on other sites More sharing options...
jitesh Posted July 30, 2007 Share Posted July 30, 2007 For persistent cookie You must have to give expire time. You can set it for many years. Example : 100 Years setcookie('name','value',time()+100*365*24*60*60); Link to comment https://forums.phpfreaks.com/topic/62411-solved-cookies/#findComment-310638 Share on other sites More sharing options...
Devine Posted July 30, 2007 Author Share Posted July 30, 2007 I want to offer the possibility of being "logged in forever".. (aslong as they dont delete the cookies from their browser. Link to comment https://forums.phpfreaks.com/topic/62411-solved-cookies/#findComment-310640 Share on other sites More sharing options...
steelmanronald06 Posted July 30, 2007 Share Posted July 30, 2007 make the cookie time expire like so: $lp = 0; $setup = 100; while ($lp < 100) { $setup = $setup * 100; $lp++; } setcookie("TestCookie", $value, $setup); Link to comment https://forums.phpfreaks.com/topic/62411-solved-cookies/#findComment-310642 Share on other sites More sharing options...
Devine Posted July 30, 2007 Author Share Posted July 30, 2007 For persistent cookie You must have to give expire time. You can set it for many years. Example : 100 Years setcookie('name','value',time()+100*365*24*60*60); And it won't be taken deleted as soon as they close their browser right? Link to comment https://forums.phpfreaks.com/topic/62411-solved-cookies/#findComment-310643 Share on other sites More sharing options...
jitesh Posted July 30, 2007 Share Posted July 30, 2007 And it won't be taken deleted as soon as they close their browser right? Yes. It will not be deleted up to set expire time. Link to comment https://forums.phpfreaks.com/topic/62411-solved-cookies/#findComment-310644 Share on other sites More sharing options...
steelmanronald06 Posted July 30, 2007 Share Posted July 30, 2007 well, it depends on browser settings. If they have it to delete cookies, clear history after 0 days, etc like I do, then everytime they close the browser their cookies and history are deleted. Link to comment https://forums.phpfreaks.com/topic/62411-solved-cookies/#findComment-310646 Share on other sites More sharing options...
steelmanronald06 Posted July 30, 2007 Share Posted July 30, 2007 sorry. we keep posting at the same time. Link to comment https://forums.phpfreaks.com/topic/62411-solved-cookies/#findComment-310647 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.