IE can not set the short domain name Cookie_javascript skills

Source: Internet
Author: User
The cookie Setup failed after some simple troubleshooting and found the problem.

But as for why failed, this problem check for a long time, and finally in the stackoverflow above someone mentioned, ie from 5.0 can not be a short domain name under the cookie set.

So how short will there be problems? After testing, it was found that a total of 5 characters, including dots, would not be able to set cookies through JavaScript, but there is a prerequisite that you explicitly specify the domain parameter when you set up the cookie to fail. Which means if you write this:

View source code Printing help document.cookie= "key=value;domain=ab.cn";

The cookie setting fails, and if you remove the domain parameter, write it directly:

View source code Printing help document.cookie= "Key=value";

This problem does not occur, even if the current domain is still ab.cn.

This article http://support.microsoft.com/kb/310676/en-us/mentioned a similar problem, but it seems quite different from this. We can also refer to it.

Because the cookie set failed, our traffic monitoring system thought that each access was a new access, the natural bounce rate is very high, and GA looks like the cookie set failed to send data.

Firefox and Chrome don't have the same problem.

Mark, I want to help people who are having 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.