Forum: Ruby on Rails Cookies are broken

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
0da14958309337d542fbffb8af2dd8cf?d=identicon&s=25 zkarcher (Guest)
on 2005-11-12 12:49
(Received via mailing list)
Hi all,
I'm getting errors whenever I try to do anything with cookies. Here is
the offending code fragment, this is in app/helpers/news_helper.rb :

- - -

def last_survey_answered
  if cookies[:survey_answered]
    return cookies[:survey_answered]
  end
  return 0
end

- - -

I have also tried simple cookie commands such as:
cookie[:test] = "Hi" . The error I'm getting is:


undefined local variable or method `cookies' for
#<#<Class:0x25b8ca8>:0x25b8870>


Do I need to install a gem?? I tried upgrading rails to the latest
version (0.14.3) and the error is the same. Please help. Thanks

-- Zach
E13ba8e702211be152c640df2d8e141f?d=identicon&s=25 Joe Black (joe-black)
on 2005-11-24 20:23
i think you miss a 's'
cookies[:test] = "Hi"
57d2594584b9c4e2b6fb2059968b3d84?d=identicon&s=25 John Henderson (jh100000)
on 2006-04-20 22:37
Joe Black wrote:
> i think you miss a 's'
> cookies[:test] = "Hi"


still doesn't work... its driving me mad too.
This topic is locked and can not be replied to.