I set a cookie on Rails like this,
cookies[:account] = { :value => @account.to_s, :expires => 3.month.from_now }
Which seems to be workin
[object Object]
is the return value from Object.toString()
, so that means that $.cookie('account') is returning a non-Number, non-String object.
On way to start figuring out what's in the return value (in an effort to help you determine what's in the object returned) is to loop over the properties to figure it out.
So, like this:
var obj = $.cookie('account');
var msg = [];
for(var i in obj) msg.push( i +" = " + obj[i]);
alert(msg.join("\n")); // or console.log(msg.join("\n"));