I set a cookie on Rails like this,
cookies[:account] = { :value => @account.to_s, :expires => 3.month.from_now }
Which seems to be workin
Cookie has a maximum size of 4kb only. That could be one of the reasons.
As for my case. It certainly exceeds 4kb looking at the data alone.
My alternative though is using localStorage.