Why jQuery.cookie returns “[object Object]” for a single string value

后端 未结 5 1520
故里飘歌
故里飘歌 2021-01-26 11:40

I set a cookie on Rails like this,

cookies[:account] = { :value => @account.to_s, :expires => 3.month.from_now }

Which seems to be workin

5条回答
  •  轮回少年
    2021-01-26 11:58

    You can use Mozilla Library. You'll be able to set and get cookies like this

    docCookies.setItem(name, value);
    docCookies.getItem(name);
    

提交回复
热议问题