Wednesday, September 30, 2009

How Can I Avoid "Page Has Expired" Warnings


Most of the time many developer may face in this problem in may times. Might be they have already solved or not. Here i m pointing why is it happing and how to solve it.

The warning is a result of the user utilizing the browser's history mechanism to access a previously viewed page, usually by clicking the back button or refreshing. One cause of the warning is that the page has expired from the browser's cache.

PHP, by default, does not forbid caching. When you request a simple PHP script, no caching headers are returned. To solve this you can use two ways.

1) Edit php.ini file.

Set session.cache_limiter to PRIVATE by default it comes with nocache.
 session.cache_limiter = private
 

2) Edit through you PHP Code
      ini_set('session.cache_limiter', 'private');
 


No comments: