0

I can't, for the life of me, figure this one out.

This site used to work fine in IE but now it refuses to set cookies. I have tested it in multiple versions on multiple computers and yet still no avail. It behaves normally in all other browsers. The source code hasn't changed, neither has any update been applied to the server.

setcookie() returns TRUE for that matter but I check and no cookie was set.

I checked the time of the server and it is accurate to the second. I have created a sample file with JUST setcookie() and on this domain it doesn't work. All others work properly. Even tried setting the required parameters to all. I have no clue as to what could be wrong.

Version Info:

  • PHP Version 5.1.6
  • Apache/2.2.3 (CentOS)

EDIT - SAMPLE CODE

setcookie("session", "e180564a1b6533ec5b0c63e8009d0bc27a90b226", time()+3600);

EDIT 2

It appears as though the client hired another development team who destroyed the DNS, has the A record pointed to another server and is forwarding all traffic via some means to the correct one without changing the URL in the address bar.

This one may have been solved.

Any ideas?

Bryan
  • 51
  • 1
  • 6
  • 1
    Some sample code that shows the call to `setcookie` would help. – casablanca Jan 14 '11 at 15:46
  • Have you tried running your code from another server using the same IE? If IE's blocking cookies from your site, it would theoretically allow the the cookie through since it's coming from a different site now. Of course, you'd better check if IE's accepting cookies, period. – Marc B Jan 14 '11 at 16:23

3 Answers3

1

Are you sure that cookies are enabled in Internet Explorer? This is the most common cause in my opinion.

See http://kb.iu.edu/data/ajfh.html for reference.

mrwooster
  • 23,789
  • 12
  • 38
  • 48
  • Yes they are and it is on multiple computers, all versions of IE on all of these computers didn't work. – Bryan Jan 14 '11 at 17:47
0

I've seen IE security settings cause problems with cookies as well. I've never been able to narrow it down to a specific one, but sometimes a P3P header can help - see here for more information: http://articles.sitepoint.com/article/p3p-cookies-ie6/2.

Chris
  • 1,118
  • 8
  • 24
  • Not saying it will work but it was a possibility, also remember you need to craft your compact policy to match your site - not just copy the one from that page. – Chris Jan 14 '11 at 18:13
0

Are the domains/subdomains proper ones? IE will not set a cookie if the domain does not follow the RFC. The most common cause for this is an underscore _ in the subdomain.

Community
  • 1
  • 1
Fanis Hatzidakis
  • 5,282
  • 1
  • 33
  • 36