tags:

views:

27

answers:

2

I'm using cookie plugin with jquery. I set cookie like $.cookie('key','value'). In firebug I can see that the cookie is set but console.log($.cookie('key')) returns null.

What am I doing wrong ?

A: 

Nothing wrong. It should work

DixonD
This can be a comment !
Ninja Dude
I believe that I answered asked question:)
DixonD
+1  A: 

Try adding more parameters, only for testing:

$.cookie('the_cookie', 'the_value', { expires: 7, path: '/', domain: 'jquery.com' });

To verify the value of the cookie, you can also use the Web Developer Extension, they have an option for view cookies.

netadictos
$.cookie('key','value', {path : '/'}); did the trick. I noticed that the cookie was set for the current page only
adaxa