PHP page Jump session cookie loss results in problems such as not login _php instance

Source: Internet
Author: User

thinkphp development of a project, login successfully and then jump to the login page, in the submission of information after the output session is normal, no problem, but the page jump, session loss phenomenon, can not complete landing.

By looking for information, found that the original is the BOM header reason. With the restriction of the cookie delivery mechanism, the cookies cannot be delivered in the file with the BOM at the beginning of the file (because PHP has sent the file header before the cookie is sent out), so the login and logout functions fail. All the functionality that relies on cookies and session implementations is invalid.

The correct way is to remove some of the file BOM, the general situation is in the entry file BOM problem, I deal with the method is to open the file with notepad++, format selection to UTF-8 no BOM format, and then save, upload to the server. But it must be noted that the removal of the BOM upload to the server before the need to delete the source files on the server, upload cover can not remove the BOM.

After the BOM is removed, session cookie loss problem is resolved.

The above is a small set to introduce the PHP page jump session cookie loss caused by the problem can not be logged on, such as the solution, I hope to help you, if you have any questions please give me a message, small series will promptly reply to everyone. Here also thank you very much for the cloud Habitat Community website support!

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.