Cookies basically can only store strings (for each first-level key).
In order to store hash in cookies values, you need serialize/deserialize the data, for example, with JSON
cookies[:i_need_to_store_hash] = hsh.to_json
and than
i_need_to_get_my_hash_back = JSON.parse(cookies[:i_need_to_store_hash])
but remember that cookies very limited in size (4096 bytes)