Skip to content
Browse files

Deprecate ActionController::Response#set_cookie :http_only option inf…

…avor of :httponly
  • Loading branch information...
1 parent 3c625d6 commit 0edb0a4facdf6de8d12a004b59232e1006b93cd9 @josh josh committed Feb 7, 2009
View
2 actionpack/lib/action_controller/cookies.rb
@@ -41,7 +41,7 @@ module ActionController #:nodoc:
# * <tt>:expires</tt> - The time at which this cookie expires, as a Time object.
# * <tt>:secure</tt> - Whether this cookie is a only transmitted to HTTPS servers.
# Default is +false+.
- # * <tt>:http_only</tt> - Whether this cookie is accessible via scripting or
+ # * <tt>:httponly</tt> - Whether this cookie is accessible via scripting or
# only HTTP. Defaults to +false+.
module Cookies
def self.included(base)
View
3 actionpack/lib/action_controller/response.rb
@@ -169,6 +169,9 @@ def write(str)
def set_cookie(key, value)
if value.has_key?(:http_only)
+ ActiveSupport::Deprecation.warn(
+ "The :http_only option in ActionController::Response#set_cookie " +
+ "has been renamed. Please use :httponly instead.", caller)
value[:httponly] ||= value.delete(:http_only)
end
View
2 actionpack/test/controller/cookie_test.rb
@@ -33,7 +33,7 @@ def delete_cookie_with_path
end
def authenticate_with_http_only
- cookies["user_name"] = { :value => "david", :http_only => true }
+ cookies["user_name"] = { :value => "david", :httponly => true }
end
def rescue_action(e)

0 comments on commit 0edb0a4

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