cookie issue in IE using java script in asp.net

I have implemented cookie on my site and its calling from all master pages.

I am using following code in javascript for creating cookie:

document.cookie = name + "=" + value + expires + ";domain=.example.com; path=/";

Its not working in IE for all pages of same domain, it create cookie only for pages on root.


I was testing this on two servers.

One was test server and another was live server and domain were like test.example.com and www.example.com.

On test I was taling path='/root' and domain='.test.example.com' and it was working well.

But on live server domain='.example.com' worked instead of domain='.www.example.com' and it happen only in case of IE as in case of other browser domain='.www.example.com' working well.

链接地址: http://www.djcxy.com/p/44896.html

上一篇: 在登录时设置Cookie

下一篇: 在asp.net中使用java脚本的IE中的Cookie问题