naohirozrx / reallysimplehistory

Automatically exported from code.google.com/p/reallysimplehistory
Other
0 stars 0 forks source link

PHP session management breaks isFirstLoad() in IE #36

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1. Rename rshTestPage.html to rshTestPage.php
2. Insert the following at the top of rshTestPage.php:
<?php session_start(); ?>
3. Upload file to server running PHP
4. Navigate to file in IE6, add history items, go off-site, then back to
rshTestPage.php.

What is the expected behavior? What do you see instead?
When going off-site then back to rshTestPage.php, isFirstLoad() will always
return TRUE on IE 6.  It works properly with FireFox 2.0.

Please provide any additional information below.
I verified my PHP installation is not tracking sessions via URL, and is
only using cookies.

I added the following two lines to the onload function of rshTestPage to
debug first loads:

    if (dhtmlHistory.isFirstLoad())
        log("<b>First load.</b>");

It is useful to test the functionality of that routine in rshTestPage, so I
recommend adding it for future releases.

Original issue reported on code.google.com by ois...@gmail.com on 5 Dec 2007 at 5:26

GoogleCodeExporter commented 8 years ago
This problem is more generically associated with server-side dynamically 
generated
pages.  It appears that the HTTP headers PHP sends when sessions are in use 
specify
cache control values that cause a complete reload of the page in IE when 
navigated
back to after going off-site.  A work-around is to explicitly tell PHP what 
type of
caching the browser is to use.  However, this will likely have ramifications 
with
dynamically generated PHP pages that cannot be cached.  In my case the page is
completely DHTML, so the page is essentially static from a caching standpoint.  
It
may be possible to tune the brower's cache control with appropriate page 
expiration
values that could allow dynamic server-side pages and still allow navigation 
back to
the page after a short duration off-site navigation.

Adding the following line BEFORE session_start() will take care of the problem:

session_cache_limiter('public');

Original comment by ois...@gmail.com on 5 Dec 2007 at 12:15

GoogleCodeExporter commented 8 years ago
I am happy to add this logging to the test page and add the issue of HTTP 
headers to
the FAQ that's I'm in the process of writing. Thanks for pointing out this 
issue and
finding your own server-side solution! Keeping the issue open until I add the 
test
and the documentation.

Original comment by bdpathfi...@gmail.com on 11 Dec 2007 at 6:08

GoogleCodeExporter commented 8 years ago
Also, could you comment as to why you need to set caching headers on blank.html 
at
all? Does PHP require you to do this for all pages on your site, even utility 
pages
like this one? Does it throw errors if you don't? Is there some other magic 
you're
trying to work in blank.html with custom code of some kind? I just want to 
understand
why this error came up?

Original comment by bdpathfi...@gmail.com on 11 Dec 2007 at 11:30

GoogleCodeExporter commented 8 years ago
I've added this to the FAQ with a pointer to this bug thread for further 
reference.
Closing as this is not an issue with RSH but an issue with how PHP is 
configured by
the application developer.

Original comment by bdpathfi...@gmail.com on 11 Dec 2007 at 11:43

GoogleCodeExporter commented 8 years ago

Original comment by bdpathfi...@gmail.com on 11 Dec 2007 at 11:44