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. Quote 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. Quote Link to comment https://forums.phpfreaks.com/topic/181503-cookies-wont-set-expiration/#findComment-957446 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.