From 6acda705dcee10cb31aae5ab8f6442f8006e4b37 Mon Sep 17 00:00:00 2001 From: David Heinemeier Hansson Date: Sun, 17 Apr 2005 07:18:39 +0000 Subject: Added that deleting a cookie should not just set it to an empty string but also instantly expire it #1118 [todd@robotcoop.com] git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@1180 5ecf4fe2-1ee6-0310-87b1-e25e094e27de --- actionpack/lib/action_controller/cookies.rb | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'actionpack/lib') diff --git a/actionpack/lib/action_controller/cookies.rb b/actionpack/lib/action_controller/cookies.rb index b82aa5ee08..81f176ad32 100644 --- a/actionpack/lib/action_controller/cookies.rb +++ b/actionpack/lib/action_controller/cookies.rb @@ -54,9 +54,10 @@ module ActionController #:nodoc: set_cookie(options) end - # Removes the cookie on the client machine by setting the value to an empty string. + # Removes the cookie on the client machine by setting the value to an empty string + # and setting its expiration date into the past def delete(name) - set_cookie("name" => name.to_s, "value" => "") + set_cookie("name" => name.to_s, "value" => "", "expires" => Time.at(0)) end private -- cgit v1.2.3