Conflagration of IE6, PHP session_start, and blank pages

Yesterday, I was troubleshooting a problem that (only) showed up in IE6 where anytime I click a link that goes to a page with session_start() in it, I get a blank page with no errors and the address bar shows the old address, and when I hit refresh, it goes to the new page and works perfectly. Bizarre.

It seems that lots of other people have run into this situation. Not a lot of people seem to get to a solution, or alternatively, they don’t post it. So, I have finally found the culprit, and I’m posting my “solution,” even though I don’t think it’s perfect. If you comment out the character encoding meta tag on the first page to start a session (in this instance, the login page), it seems to make all the problems go away.

Not having a character encoding meta tag is definitely invalid code, so I conditionally commented it out for only IE6. Not perfect, but neither is IE6. (W3C standard says to falls back to UTF-8, which is what I want anyway, so it’s getting where I want it to, just not explicitly.) Please let me know if you run into this post and come up with a better solution.

About Scott Allen

Scott Allen is a web developer from Indianapolis, Indiana. He has been working with HTML, CSS, PHP, & MySQL since the late '90s, and has extensive experience in database design and development, server-side scripting, content management, and front-end user experience, especially in the creation of educational content. Connect with Scott on Twitter (preferably), or Facebook or Google+ (if you aren't in a hurry).
This entry was posted in Code, Tech and tagged , , . Bookmark the permalink.

Leave a Reply

Your email address will not be published. Required fields are marked *