I discovered while testing a locally hosted site that in Chrome my sessions were working correctly but in the IE and Firefox my session cookies were failing to be set. After some research I discovered that IE/FF were having trouble with the domain of which the cookie was set to use. I'd forgotten that a while back I'd changed PHP's 'cookie_domain' to a specific domain to allow me to test sub-domains and such, this meant that IE and FF were failing to accept the cookie whereas Chrome was a little more accepting for cookies it figured were from localhost. All is needed is for you to set the 'cookie_domain' in the php.ini to 'false', 'null' or '' in order to accept cookies from localhost correctly. See http://www.php.net/manual/en/session.configuration.php#ini.session.cookie-domain for more information.
PHP Cookies/Sessions failing to set in Internet Explorer/Firefox
Written on
2013-02-01
.