1
0
Fork 0
mirror of https://github.com/rails/rails.git synced 2022-11-09 12:12:34 -05:00

Simplified the set_cookie method and made it indifferent to symbol or string as name

git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@343 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
This commit is contained in:
David Heinemeier Hansson 2005-01-06 23:25:19 +00:00
parent 70039d1e91
commit 98c02b9656

View file

@ -51,16 +51,16 @@ module ActionController #:nodoc:
options = { "name" => name, "value" => options }
end
set_cookie(name, options)
set_cookie(options)
end
# Removes the cookie on the client machine by setting the value to an empty string.
def delete(name)
set_cookie(name, "name" => name, "value" => "")
set_cookie("name" => name.to_s, "value" => "")
end
private
def set_cookie(name, options) #:doc:
def set_cookie(options) #:doc:
options["path"] = "/" unless options["path"]
cookie = CGI::Cookie.new(options)
@controller.logger.info "Cookie set: #{cookie}" unless @controller.logger.nil?