title: Rails save object to cookie
body: <p>How can I serialize an array or an object and then save it into a cookie?</p>
  
  <pre><code>cookies[:mydata] = serialize({
    :key1 =&gt; 'tralala',
    :key2 =&gt; 'hahaha'
  })
  </code></pre>
  
  <p>Thx!</p>