BriceH Posted November 14, 2009 Share Posted November 14, 2009 I set a cookie using the following code: setcookie("sample_cookie", "1", time()+60*60*24*365); When I view the cookie, it says that it expires at the end of the session. Do you know what the problem is? I've tried it in both Safari and Firefox. Link to comment https://forums.phpfreaks.com/topic/181503-cookies-wont-set-expiration/ Share on other sites More sharing options...
PFMaBiSmAd Posted November 14, 2009 Share Posted November 14, 2009 There is nothing wrong with the posted statement and it works in FF. Best guess is that you are looking at an old existing cookie that has already expired and that the setcookie() statement you posted is not being executed or is not sending the cookie due to a header error. Link to comment https://forums.phpfreaks.com/topic/181503-cookies-wont-set-expiration/#findComment-957446 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.