"Warning: Web page expired Resolution" appears with History.back ()

Source: Internet
Author: User

Reason:
The Session_Start function is used in the form submission page. Since we are back browsing the cached page, the function forces the current page not to be cached.
Solve:
Php:
This prompt appears on a post-submitted page, and after you point to another page, IE will display this prompt when you return through JavaScript. Had encountered many times before, but did not care too much, Baidu is the session in the original.
When passing the back button of IE or history.go (-1) in the Web page, we will see the cache page, but after using Session_Start, this function will force the current page not to be cached, resulting in a "warning: the page has expired."
Workaround One:
Add a header after Session_Start ("Cache-control:private"); Note that the program cannot have any output before this.
Note that your PHP program cannot have any output or blank before the bank

Solution Two: Session-based approach
Add Session_cache_limiter (' Private ') before Session_Start; Do not clear the form until the session is in effect
Session_cache_limiter also has the meaning of another two parameters:
Session_cache_limiter (' NoCache ');//emptying the form
Session_cache_limiter (' public '); Do not empty the form as if no session was used
Solution Three:
Change the configuration file php.ini. Change the file in Session.cache_limiter = NoCache to Session.cache_limiter = or Session.cache_limiter = None, and then restart Apache.
Java:
When using JavaScript's History.back () to return, it is sometimes suggested that "webpage is out of date", mostly because the form of the target page is the post submission method, and it is the response page after the form has been submitted, unable to find the specific parameter in the form

Number, and "error", the specific solution:
First, in the target page to be returned, add <%response.setheader ("Cache-control", "public"); %>
Second, the target page of the form of method= "post" removed, or to method= "get".

"Warning: Web page expired Resolution" appears with History.back ()

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.