Image Image Image Image Image Image Image Image Image Image

Technology Blog | JasonSlater.co.uk Technology News | May 21, 2013

Scroll to top

Top

No Comments

PHP: Webpage expired warning in Browser

One of the early problems I happened upon during my search engine development research project was the problem of clicking the back button in the browser. As the number of links in the project increases so too does the likelihood of the user using the back button. The problem is that of the apparently broken browser history when clicking the back button in the browser which leads a "Webpage expired" warning being presented to the user.

This problem only emerged when I started applying session state management functions.

Fortunately, PHP has the session_cache_limiter function which can be used to set the caching directive, in this case tell the browser to perform its own caching through the use of private mode – or the private_no_expire mode for dealing with problems in the browser.

When using the session_start command – the caching becomes disabled, but fortunately we can set the caching directive using the command:

ini_set('session.cache_limiter', 'private');

This sets the caching to local (browser) based caching only which deals effectively with the browser history problem where public caching may cause issues.

Submit a Comment