diff options
author | David Heinemeier Hansson <david@loudthinking.com> | 2004-12-10 17:16:11 +0000 |
---|---|---|
committer | David Heinemeier Hansson <david@loudthinking.com> | 2004-12-10 17:16:11 +0000 |
commit | 1188d3005a35df9a9ef3fd43b6ab7252b10399aa (patch) | |
tree | fe4f8bddc637bf8b49f028ef81a4cdf2fba0cdb4 /actionpack/lib/action_controller | |
parent | 0c72e6d665048d51de06f6bc3dfe674be31391a4 (diff) | |
download | rails-1188d3005a35df9a9ef3fd43b6ab7252b10399aa.tar.gz rails-1188d3005a35df9a9ef3fd43b6ab7252b10399aa.tar.bz2 rails-1188d3005a35df9a9ef3fd43b6ab7252b10399aa.zip |
Fixed problem with cookies not being set to path=/ by default and a test buggerboo
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@110 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
Diffstat (limited to 'actionpack/lib/action_controller')
-rw-r--r-- | actionpack/lib/action_controller/cookies.rb | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/actionpack/lib/action_controller/cookies.rb b/actionpack/lib/action_controller/cookies.rb index 626a2ce814..1eb071bdbe 100644 --- a/actionpack/lib/action_controller/cookies.rb +++ b/actionpack/lib/action_controller/cookies.rb @@ -44,7 +44,7 @@ module ActionController #:nodoc: options.each { |key, value| options[key.to_s] = value } options["name"] = name.to_s else - options = [ name, options ] + options = { "name" => name, "value" => options } end set_cookie(name, options) @@ -57,7 +57,8 @@ module ActionController #:nodoc: private def set_cookie(name, options) #:doc: - cookie = options.is_a?(Array) ? CGI::Cookie.new(*options) : CGI::Cookie.new(options) + options["path"] = "/" unless options["path"] + cookie = CGI::Cookie.new(options) @controller.logger.info "Cookie set: #{cookie}" unless @controller.logger.nil? @controller.response.headers["cookie"] << cookie end |