Categories > TinyButStrong general >

OT - browser refresh

The forum is closed. Please use Stack Overflow for submitting new questions. Use tags: tinybutstrong , opentbs
By: TomH
Date: 2012-07-31
Time: 20:06

OT - browser refresh

Hello all,
I'm trying to sort out a 'browser refresh' problem..

I have two identical TBS pages/scripts - only difference is the file name.
The php page displays the results of a db query.
The results display links to details of the individual records.
Clicking a link runs a different script that displays the details in the same window

The the problem arises when I click the browser back button (to return to the list of the previous query results)...
* in MSIE the browser always requires a reload /refresh
* in Firefox the browser sometimes requires a refresh on one of the scripts and always requires refresh on the other script
* in Safari neither scripts require a refresh - the previous page af search results are displayed as expected.

(all browsers are latest versions)

Can anyone give me any clues as to what can be done to stop the browsers (MSIE and Firefox) from requiring a refresh when using the back button to return to the search results page??

Sorry for the OT - but there are some really smart people on this list, so I hope to get some kind of illumination at least

Thanks for TBS every day,
TomH


By: Skrol29
Date: 2012-08-02
Time: 02:26

Re: OT - browser refresh

Hi TomH,

You can force the refresh when going back on the page.
You can use header for avoiding the cache
  stackoverflow.com/questions/3645609/

Or use session_start() to simulate a new session.
By: TomH
Date: 2012-08-02
Time: 15:27

Re: OT - browser refresh

Thanks for answering skrol29,
I guess I was unclear bout what i was having trouble with

I do NOT want the browser to force a refresh -- that is the automatic behavior of Firefox and MSIE. ((The Opera and Safari browsers do not have this problem))
This is the Firefox message screen
Document Expired
             
This document is no longer available.    

* The requested document is not available in Firefox's cache.As a security precaution, Firefox does not automatically re-request sensitive documents.
* Click Try Again to re-request the document from the website.

I want the browser to cache the db query results page.
When the use clicks a link on the result page a deatil page  for that item is displayed. Then I want the back button to take them back to the results listing page (from browser cache) without forcing the user to do a reload.

Hope that helps ;)

Thanks for TBS every day, and for TBSSQL debug console 100 times a day ;)
TomH
By: Anonymous
Date: 2012-08-03
Time: 04:53

Re: OT - browser refresh

Okay,

Skrol29's mention of session_start caused me to remember that I am running phpSecurePages on these pages.
So... on a hunch, I temporarily turned OFF the phpSecurePages module -and- now the browser is caching the results page, it is now instantly available fomr to next page when the browser back button is clicked.

So now I am guessing that it's something about the php session that is preventing the browser from caching the results page.

But i dop not understand why, nor can I even remotely guess whether or not it is possible to have the sessions on for phpSecurePages and also have the browser cache the results page

Any ideas???  WIllng to try anything that anyone might know, suggest, or even wild guess!

Thanks for your patience

Thanks for TBS every day,
TomH

By: Anonymous
Date: 2012-08-03
Time: 05:10

Re: OT - browser refresh

Solved!

FWIW (maybe some who searches this forum)

by changing the session handling before calling the phpSecurePages module as follows
// NB ref http://www.php.net/manual/en/function.session-cache-expire.php
session_cache_limiter('private');  // WORKS to enable Firefox caching the results so BACK button works
// log in for customer/user priveliges
$minUserLevel = 99;
$cfgProgDir = '/phpSecurePages/';
include($cfgProgDir . "secure.php");
 
This change to session cache limiter causes php to set and send the proper headers for controlling the cache.
In my case -- to tell the browser to cache the page

Hope that helps someone as newbie as me in the future ;)

Thanks
TomH
By: Skrol29
Date: 2012-08-05
Time: 23:54

Re: OT - browser refresh

Thank for the information.