From 447c2cb1b0684c6efcfe1063222d537567fa1d3e Mon Sep 17 00:00:00 2001 From: Aaron Patterson Date: Thu, 6 Aug 2015 07:54:47 -0700 Subject: add a setter for the cookie jar --- actionpack/lib/action_dispatch/middleware/cookies.rb | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'actionpack/lib/action_dispatch') diff --git a/actionpack/lib/action_dispatch/middleware/cookies.rb b/actionpack/lib/action_dispatch/middleware/cookies.rb index e6b799cb2f..4e3a2fb637 100644 --- a/actionpack/lib/action_dispatch/middleware/cookies.rb +++ b/actionpack/lib/action_dispatch/middleware/cookies.rb @@ -8,7 +8,12 @@ require 'active_support/json' module ActionDispatch class Request < Rack::Request def cookie_jar - env['action_dispatch.cookies'] ||= Cookies::CookieJar.build(self, cookies) + env['action_dispatch.cookies'.freeze] ||= Cookies::CookieJar.build(self, cookies) + end + + # :stopdoc: + def cookie_jar=(jar) + env['action_dispatch.cookies'.freeze] = jar end def key_generator @@ -42,6 +47,7 @@ module ActionDispatch def cookies_digest env[Cookies::COOKIES_DIGEST] end + # :startdoc: end # \Cookies are read and written through ActionController#cookies. -- cgit v1.2.3