JQuery Cookie plug in behavior: sets the domain to ".com" if cookie is a session cookie

People,

I found that the jQuery cookie plugin sets the domain to ".com" if the cookie I set is a session file.

Here is the code:

jQuery.cookie("currentTab", selectedTab ); 

If I view cookies using the IE Developer Tool, it shows the domain as ".com".

If I ask this path:

 jQuery.cookie("currentTab", selectedTab, { expires: 1} ); 

... then it has “www.sitename.com” as the domain.

Is there any trick I'm missing, or have I found a mistake?

Thanks.

+4
source share
1 answer

Ok, I created this http://jsfiddle.net/jvDXZ/ and checked it in Chrome and Firefox (a tool for web developers> cookies> View cookie information) and they had fiddle.jshell.net for both cookie files. In IE8, IEDT tells me that it cannot find the cookie (?) On all the pages that I checked.

You can check your IE if the cookie is available through another .com . If this is not the case (but you can access it through your www.sitename.com ) - this is clearly an IEDT error.

0
source

All Articles