Internet Explorer Cookie failure caused by domain name

Source: Internet
Author: User
Tags rfc

Two days ago, we tested the system by configuring the host on the test server. We found that there was a problem with Cookie reading and writing under ie. At first we thought it was a problem with code and framework, so I wrote a simple PHP page to read and write data, and found that it still does not work. Through the fiddler packet capture software, it is found that the cookie does have normal transmission, indicating that the network is OK. Later I suspected it was a PHP configuration problem. So I converted the PHP language into js to read and write cookies, and found that it still did not work. Later, a test colleague accidentally accessed the cookie in IE through the domain name. Therefore, it was suspected that there were special characters in the domain name because IE had an exception in cookie resolution. After investigation, it is found that domain names with "_" in the domain name will cause IE cookie exceptions. Remove _. Everything is normal. Finally, the following information is found through searching for information:


According to rfc1035 (domain names-implementation and specification ):
[Domain names] must start with a letter, end with a letter or digit, and have as interior characters only letters, digits, and hyphen.
Turns out some of the domains had an underscore ("_") in them: some_domain.example.com. Although this is a violation of the RFC, all other browsers work normally.
MSIE 7, on a domain with an underscore, silently drops all cookies for that host and refuses to accept new ones.
The only solution is to use RFC-compliant domains (I 've replaced all the "_" s with "-" s and set up a rewriterule so that traffic is redirected to the compliant Domains ).


According to rfc1035 rules, the implementation and specifications of a domain name must start with a letter and end with a letter or number. Other parts must be digits, letters, or hyphens -.

When it comes to msie7, domain names including _ will discard all cookies and refuse to accept new ones.

Related Article

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.