IE cannot set the cookie under the short domain name

Source: Internet
Author: User

After some simple troubleshooting, I found the problem and failed to set the cookie.

But as to why the failure occurred, I checked the problem for half a day and finally mentioned above in stackoverflow that IE cannot set cookies for short domain names since 5.0.

So what will happen if it is too short? After the experiment, we found that the cookie cannot be set through javascript for a total of five characters including periods and numbers, but there is a premise, that is, the domain parameter cannot be explicitly specified only when you set the cookie. That is to say, if you write:

ViewSource codePrint the help document. Cookie = "Key = value; domain = AB .cn ";

Cookie setting will fail. If the domain parameter is removed, write it as follows:

View SourceCodePrint the help document. Cookie = "Key = value ";

This problem will not occur, even if the current domain is still AB .cn.

This articleArticleBytes. For more information, see.

Because the cookie setting fails, our traffic monitoring system considers that each access is a new access, and the bounce rate is very high. Ga does not send data if the cookie setting fails.

Firefox and chrome have no such problems.

Mark, hope to help people who encounter similar problems.

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.