Skip to content
Browse files

Added that deleting a cookie should not just set it to an empty strin…

…g 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
  • Loading branch information...
1 parent ed46cc3 commit 6acda705dcee10cb31aae5ab8f6442f8006e4b37 @dhh dhh committed Apr 17, 2005
Showing with 5 additions and 2 deletions.
  1. +2 −0 actionpack/CHANGELOG
  2. +3 −2 actionpack/lib/action_controller/cookies.rb
View
2 actionpack/CHANGELOG
@@ -1,5 +1,7 @@
*SVN*
+* Added that deleting a cookie should not just set it to an empty string but also instantly expire it #1118 [todd@robotcoop.com]
+
* Added AssetTagHelper#image_path, AssetTagHelper#javascript_path, and AssetTagHelper#stylesheet_path #1110 [Larry Halff]
* Fixed url_for(nil) in functional tests #1116 [Alisdair McDiarmid]
View
5 actionpack/lib/action_controller/cookies.rb
@@ -54,9 +54,10 @@ def []=(name, options)
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

0 comments on commit 6acda70

Please sign in to comment.
Something went wrong with that request. Please try again.