0

I am facing issue with cookies using Jquery Cookie plugin.

In my code, i used to set cookie like this.

$.cookie("example", "value1"); 

I am facing problem when i override cookie value, so i changed my code as below.

$.cookie("example", "value2", { path: '/' });

If i try to get cookie value , i am getting "value1" not "value2"

alert( $.cookie("example") );

How to retrieve "value2" in a path.

Here is Jsfiddle link i tried. http://jsfiddle.net/x99Et/1/

Thanks in advance.

Ashok.

4

1 回答 1

0
alert( $.cookie("example", {path: '/'}) );

当你这样做时,它会返回一个对象。但我仍然不知道为什么。

于 2013-04-29T10:06:27.243 回答