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

后端 未结 5 1472
故里飘歌
故里飘歌 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

    To anyone else that runs into this, check to make sure you don't have multiple cookies of the same name (with different paths or expirations). This can lead $.cookie() to return [object Object]

提交回复
热议问题