estrip

Pages using PHP sessions and external javascript in the head portion of the html document and which served from IIS 6 to IE 7 are not refreshing properly (displays blank on refresh). I have a full description of it here including the minimal source to create the error.

Description, source and work arounds that may shed light on the problem: http://durge.roswellpark.org/ie7Bugs/

I think it has to do with the fact that IIS does not report content-length header on pages served as PHP. If I manually create my own content-length header it works. This problem did not happen in IE 6 and will affect all php sites served from IIS 6 to IE 7 that use sessions.

Here is an example

< php
session_start();
><html>
<head>

<script type="text/javascript" src="javascript.js"></script>
<title>IE 7 false content-length - refresh bug demo</title>

</head>
<body>
<h1>IE 7 Content-Length Bugs</h1>
<p>This will not show up on refresh when served from IIS 6 with PHP 5.1.6 to IE 7.</p>
</body>
</html>



Re: Internet Explorer Web Development IE 7 display blank page on refresh when viewing session enabled PHP pages served from IIS 6!!

treacle

Perhaps this is a more general IIS6 / Session Variable / IE7 issue.

I had and reproduced the same problem when serving ASP to IE7 using IIS6. Session variables mysteriously disappearing.

Removing the javascript includes immediately solved the problem. I cut and pasted the javascript into the page directly. Luckily it's only a small code change, and not a lot of javascript. On other sites this could be a major issue.

How Microsoft didn't notice this in 2 years I don't know. Shameful.

Session variables (rightly or wrongly) are often used to control access to pages. I wouldn't be surprised if this both closes or opens some "private areas" on websites where code that assume Sessions actually work.

e.g.

(page 1)
Session ("access") = "false" [variable won't get passed to page 2 due to IE7 bug]
...
Session ("access") = "true" [variable won't get passed to page 2 due to IE7 bug]

(page 2)
If Session("access") = "true" Then... [test incorrectly assumes Session variable has been set to either "true" or "false"]

Thanks for working this out estrip!




Re: Internet Explorer Web Development IE 7 display blank page on refresh when viewing session enabled PHP pages served from IIS 6!!

treacle

Actually let me be more specific.

The problem only occurs when javascript files are included in the HEAD section of the web page.

Move them to the BODY (aka everything you have been taught and believe in) and everything works fine.

A slightly simpler solution, but not one we should need to do.




Re: Internet Explorer Web Development IE 7 display blank page on refresh when viewing session enabled PHP pages served from IIS 6!!

Ranch

Good Find! Fixed my issue! Thank you!



Re: Internet Explorer Web Development IE 7 display blank page on refresh when viewing session enabled PHP pages served from IIS 6!!

an0n1m0us

this issue is not limited to php or IIS*

The same symptoms exist with Apache 2, Perl and PostgreSQL session handling. Specificly the combination of ...

Apache::Session::Postgres
CGI
DBI

Microsoft is a disgrace.




Re: Internet Explorer Web Development IE 7 display blank page on refresh when viewing session enabled PHP pages served from IIS 6!!

emkookmer

I beleave it isnt apache nor iis

but that is the <script type="text/javascript" src="javascript.js"></script>

that stops ie from displaying the page






Re: Internet Explorer Web Development IE 7 display blank page on refresh when viewing session enabled PHP pages served from IIS 6!!

jejeSW6

Hi.
Had the same problem with a
<script src="..." type="text/javascript" />
in my header.

I fixed it by:

<script src="..." type="text/javascript" ></script>

still in the header.

It seems that ie7 doesnt like real xhtml .

Please Ms, stop torturing poor web developers..





Re: Internet Explorer Web Development IE 7 display blank page on refresh when viewing session enabled PHP pages served from IIS 6!!

pseudorand

So, has anyone actually found a solution to this problem or verified the conditions it happens (or have a reference to a KB article on it . It happens for me using php 5.1.6, IIS 6, IE 7.0.5730.11 if I have a <link> to css the comes BEFORE my <script> tag. It's the order of things, I think. What a pain MS is.




Re: Internet Explorer Web Development IE 7 display blank page on refresh when viewing session enabled PHP pages served from IIS 6!!

Jammy Dave

Just to confirm i've come across this error while developing a .net application which uses Javascript and Sessions. It's been driving me nuts happy to see i'm not alone. I've changed the JS declaration to end in </script> instead of /> and all seems ok for now but it'll could be a massive job to roll this out in existing apps! Come on microsoft bug fix.






Re: Internet Explorer Web Development IE 7 display blank page on refresh when viewing session enabled PHP pages served from IIS 6!!

rehevkor5

I've also run into this problem on a PHP site that uses sessions. However, the javascript is in the page, not linked externally. Also, it doesn't always show up blank:

Load page -> normal
Refresh -> last half of page missing
Refresh -> normal
Refresh -> normal
Click link to another page -> normal
Click link to go back to original page -> normal
Refresh -> last half of page missing
etc...




Re: Internet Explorer Web Development IE 7 display blank page on refresh when viewing session enabled PHP pages served from IIS 6!!

Krugerrand123

I'm not too sure if this has anything to do with php sessions. I have a very basic page (no sessions at all) which exhibits the exact same symptons running within IE7 on IIS6. I have included the entire script within the <head> section and sometimes it works, sometimes it doesn't. This also happens if I have the script in the <body> section. It is definately the script as when I remove it the page refreshes perfectly every time. The bizarre thing is that on other pages that use the same script, they seem to work perfectly....



Re: Internet Explorer Web Development IE 7 display blank page on refresh when viewing session enabled PHP pages served from IIS 6!!

Artur Muszy?ski

I have the same problem, but occurs also in inline scripts, body section too. DEFER attribute helped for me. Shame anyway.



Re: Internet Explorer Web Development IE 7 display blank page on refresh when viewing session enabled PHP pages served from IIS 6!!

StuartIndigo

This is definitely an IE7 problem (ie not IIS or apache - both show the same sort of fault).

I have a very similar problem, which has caused me to use an inelegant table layout instead of javascript popups, problems solely due to IE7.

I have a dating site using php & mySQL which causes the problem.

The sequence of events is as follows.

1) The user logs in and clicks on a profile to view in the main window.

2) The profile appears in a javascript popup window with a menu of possible actions - one of which is to view the pictures of the person whose profile they are viewing.

3) There then appears a gallery page which has a series of thumbnails (up to 30) in the previously opened popup window.

4) Clicking on any of the thumbnails causes the full size version of the thumbnail to appear.

At present I have to show the main picture below the thumbnails on the same page , as, if I attempt to use frames, iframes or a new javascript window, IE7 does not retain the variables and pass them to the php page used to retrieve the picture and errors with a message "Internet explorer is unable to download the file getsnap.php".

Firefox, Opera & IE6 do not have this problem (Opera & Firefox on both XP & Vista, IE7 on vista & IE6 on XP).

Has anyone found a complete solution to this problem

Stuart





Re: Internet Explorer Web Development IE 7 display blank page on refresh when viewing session enabled PHP pages served from IIS 6!!

NL-Jeffrey

The problem occurs when a <script> tag is present.

I installed Hotfix 933006 and the problem seems to be solved.

See:

http://support.microsoft.com/kb/933006

Obtain Hotfix from:

http://thehotfixshare.net/download/index.php dir=English/Windows%20XP/

Still this doesn't make a lot of sense, because you can't require your visitors to install this hotfix...





Re: Internet Explorer Web Development IE 7 display blank page on refresh when viewing session enabled PHP pages served from IIS 6!!

Lance Kujala

The hotfix is included in one of the IE7 rollups.

Plus I am having the same problem with both IE6 and IE7 (fully patched).... so this is not a problem with IE.

The setup I have is

- win2003 std / iis6

- php 5.2.3

- mysql 5.0.45

I am in the process of migrating from an older setup where the applications worked just fine.

I have a phpinfo page that displays without a problem.

I have various php sites that connect into the mysql database.

For the php sites I can open ONE page successfully; after that (opening a link or a different page or refreshing the page) the browser displays a blank page. Looking at the source, the blank page is a "valid" html page; its just blank.