What should I do if the webpage has expired?

Source: Internet
Author: User
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.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.