bestrong Posted July 29, 2009 Share Posted July 29, 2009 I am trying to set a cookie setcookie('bbs_logged_in', 1, 7200+time(),"/"); Here is the issue If i close the window and go to http://www.website.com/ the cookie is not set BUT if I type in http://www.website.com/index.php the cookie shows up fine. This is only the case in firefox, IE works fine any ideas? Link to comment https://forums.phpfreaks.com/topic/168052-firefox-and-path-of-cookies-root/ Share on other sites More sharing options...
fooDigi Posted July 29, 2009 Share Posted July 29, 2009 i set up the exact same conditions you specify and it did work for me? how do you know the cookie is not set, do you test if it exists on the same page? just checking, cause you cannot set a cookie and then test to see if it is there in the same script... what version firefox? Link to comment https://forums.phpfreaks.com/topic/168052-firefox-and-path-of-cookies-root/#findComment-886370 Share on other sites More sharing options...
bestrong Posted July 30, 2009 Author Share Posted July 30, 2009 Ok, I created a example for you go to http://www.dev.bluebeanstalk.com/make_cookie.php enter a cookie value then open a new firefox window and go to http://www.dev.bluebeanstalk.com/index.php The cookie will show at the top of the page as cookie is: [your cookie value here] now, close that window, and re open a new window and go to http://www.dev.bluebeanstalk.com The cookie value will be blank Must be in firefox Thanks. Link to comment https://forums.phpfreaks.com/topic/168052-firefox-and-path-of-cookies-root/#findComment-886419 Share on other sites More sharing options...
fooDigi Posted July 30, 2009 Share Posted July 30, 2009 i followed your instructions exactly, and when i visited http://www.dev.bluebeanstalk.com lastly, my cookie was set... ???? Link to comment https://forums.phpfreaks.com/topic/168052-firefox-and-path-of-cookies-root/#findComment-886425 Share on other sites More sharing options...
fooDigi Posted July 30, 2009 Share Posted July 30, 2009 but you might want to add the domain parameter in your setcookie function (.bluebeanstalk.com)... make sure you include beginning ".", since you are using multiple subdomains, it will make it compatible with more browsers... that could cause issues... setcookie('bbs_logged_in', 1, 7200+time(),"/",".bluebeanstalk.com"); Link to comment https://forums.phpfreaks.com/topic/168052-firefox-and-path-of-cookies-root/#findComment-886428 Share on other sites More sharing options...
bestrong Posted July 30, 2009 Author Share Posted July 30, 2009 Added the ".bluebeanstalk.com", it is working now, Thanks a bunch!! Ben Link to comment https://forums.phpfreaks.com/topic/168052-firefox-and-path-of-cookies-root/#findComment-886438 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.