Is a Hash cookie entry possible?

Hello, I want to create a cookie that is a serialized Hash.

before_filter :cookie_criteres

def cookie_criteres
cookies[‘criteres’] = if cookies[‘criteres’].nil?

But when, later in a view I want to retrieve the cookies[‘criteres’]
Hash Rails returns a CGI::Cookie instance object…

I don’t undestand how to do next - Should I cast this to a Hash (how ?)
? Is something else needed to serialize the Hash properly ?


This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs