diff --git a/actionpack/lib/action_controller/cookies.rb b/actionpack/lib/action_controller/cookies.rb index d56096818d..b23bb74f88 100644 --- a/actionpack/lib/action_controller/cookies.rb +++ b/actionpack/lib/action_controller/cookies.rb @@ -36,13 +36,13 @@ module ActionController #:nodoc: # Returns the value of the cookie by +name+ -- or nil if no such cookie exist. You set new cookies using either the cookie method # or cookies[]= (for simple name/value cookies without options). def [](name) - @cookies[name].value if @cookies[name] + @cookies[name.to_s].value if @cookies[name.to_s] end def []=(name, options) if options.is_a?(Hash) options.each { |key, value| options[key.to_s] = value } - options["name"] = name + options["name"] = name.to_s else options = [ name, options ] end diff --git a/actionpack/test/controller/cookie_test.rb b/actionpack/test/controller/cookie_test.rb index 41dc3393f1..3f9dafacd6 100644 --- a/actionpack/test/controller/cookie_test.rb +++ b/actionpack/test/controller/cookie_test.rb @@ -18,7 +18,7 @@ class CookieTest < Test::Unit::TestCase end def authenticate_for_fourten_days_with_symbols - cookies["user_name"] = { :value => "david", :expires => Time.local(2005, 10, 10) } + cookies[:user_name] = { :value => "david", :expires => Time.local(2005, 10, 10) } render_text "hello world" end