Server PHP settings cookie, client not in effect

Source: Internet
Author: User
Today encountered a very painful problem, there is a project PHP development interface to the client embedded Web page to do the application, test took 6 iphone to test, 5 devices Test No problem, 1 9.1 version of the iphone6s has been no, very strange, can not find the reason.

Then, using the Fiddler capture packet to discover that this device does not generate a cookie after the interface request that the cookie should be generated, the interface that needs to use the cookie later will not go down. Because the Web page is embedded in the client, then go to the settings to see if Safari enabled Cookie,check and found that the cookie is also enabled.

This is so strange! What else could be the reason? Glanced at the time of the device, no, not the same as the current time, half an hour faster (at that time did not notice the date, should be fast for at least one day, because the server set the cookie expiration time is 1 days). After the date is set to the correct time, the cookie can be generated.

Later, the experiment reproduced this problem, when the cookie setting expires 1 days, assuming that the current setting cookie time is March 24, 2016 22 o'clock Full (server time), and the client time is March 25, 2016 22 o'clock whole, then set the cookie will not be successful, Because the cookie has just been set to expire immediately.

The above describes the server PHP settings cookie, the client does not take effect, including aspects of the content, I hope that the PHP tutorial interested in a friend helpful.

  • 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.