Problem scenario:
Considering the size of the pop-up window and business needs, there is [More Options] next to [Submit] in the pop-up window form;
Click Submit to submit the data directly to the background for processing. Click More Options to go to another page with more details.
In order not to lose the filled-in form data in the pop-up window, the front-end uses jquery.cookie.js to store the data in cookies.
Prepare to read the data on the jump to the detailed form page.
Question:
The back-end framework uses TP. The cookie value stored in the front-end can be read under the controller Index, but it cannot be read out from other controllers. Is it strange? ? ?
< /p>
< /p>
PHP中文网2017-05-16 13:09:59
First print all cookies to see if there are cookies you have saved. Secondly, tp's cookie reading method will automatically add a prefix to prevent conflicts. Confirm. In addition, when setting cookies, you need to set the cookie's life cycle, which is the validity time. If not set. The life cycle of the current page is probably over