aooga Posted January 13, 2009 Share Posted January 13, 2009 I've been using cookies on my server for awhile, then I was upgrading and dumped my previous version into a folder 0.1 so now I access it at localhost/0.1/ and suddenly my logout script doesn't work anymore function logout(){ $past = time() - 100; setcookie('ID', gone, $past); setcookie('Key', gone, $past); } Now everytime I log out a new ID cookie is created. It seems setcookie can create cookies in path 0.1 but doesn't find them to edit them? Quote Link to comment https://forums.phpfreaks.com/topic/140639-cookie-bug-when-using-a-subdomain/ Share on other sites More sharing options...
premiso Posted January 13, 2009 Share Posted January 13, 2009 It is suggested to do more than 100 for expire time due to timezone issues, I would set the $past to time()-3600*48; (2 days ago). Working with cookies on localhost can also be tricky, checkout this article: http://www.aeonity.com/frost/php-setcookie-localhost-apache Quote Link to comment https://forums.phpfreaks.com/topic/140639-cookie-bug-when-using-a-subdomain/#findComment-736583 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.