JS History.back (); Problems with post-form data not being maintained

Source: Internet
Author: User

There are two general situations in which such problems are encountered:

=============================================

1. On the server side, such as PHP opened the session,Session_Start ();

The Session_Start () is used, and the current page is forced to not be cached.

The solution is as follows:


Add the header ("Cache-control:private") after your session_start function; Note that your PHP program cannot have any output before the bank.


There are also session-based solutions, which are preceded by a session_start

Session_cache_limiter (' NoCache ');//emptying the form

Session_cache_limiter (' private '); Do not clear the form until the session is in effect

Session_cache_limiter (' public '); Do not empty the form as if you did not use the session

=============================================

2. In the second case, the server does not open the session at all, with History.back (), and still does not maintain the form data,

The reason, the form form of the Action property must be filled out, even if it is action= "" must be filled!!! (ie is not required)


This article is from the "Half City" blog, please be sure to keep this source http://vabc1314.blog.51cto.com/2164199/1613477

JS History.back (); Problems with post-form data not being maintained

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.