Rails 1.2.2 cookies big headache!

I am trying to write a cookie :

request.cookies[‘ad_w1’] = {:value => “#{advertising.id}”, :expires =>

any other test

cookies[:user_id] = { :value => ‘123’, :expires => Time.now + 1.hour}

but I continously get an error : TypeError: can’t modify frozen hash

something gets wrong but where ?

thanks for your lights …

note : discovered that …

Rails breaks the hash implementation that cookies appear, on the
surface, to support.
For whatever reason, symbol access of values doesn’t work but string
access does. Also, for whatever reason, the nil? method will not work
but the empty? method does. Hopefully this saves somebody some

request.cookies[‘note’].value unless request.cookies[‘note’].empty?