When we use the IE back button or historygo (-1) in the webpage, we will see a cache page. However, after session_start is used, this function will force the current page not to be cached, export
Click the back button of IE or the history in the webpage. go (-1), we will see the cache page, but after session_start is used, this function will force the current page not to be cached, resulting in "warning: the webpage has expired ".
Solution 1:Add one sentence after session_start
Header ("Cache-control: private ");
Note that the program cannot have any output before that.
Solution 2:Before session_start, add
Session_cache_limiter ('private'); // do not clear the form, only during the effective period of the session
Session_cache_limiter has two meanings:
Session_cache_limiter ('nocache'); // clear the form
Session_cache_limiter ('public'); // do not clear the form, as if no session is used
Solution 3:Change the configuration file php. ini
Change session. cache_limiter = nocache to session. cache_limiter = or session. cache_limiter = none, and restart apache.