diff options
Diffstat (limited to 'actionpack/lib/action_dispatch/middleware/cookies.rb')
-rw-r--r-- | actionpack/lib/action_dispatch/middleware/cookies.rb | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/actionpack/lib/action_dispatch/middleware/cookies.rb b/actionpack/lib/action_dispatch/middleware/cookies.rb index 3ed5f1055f..24ebb8fed7 100644 --- a/actionpack/lib/action_dispatch/middleware/cookies.rb +++ b/actionpack/lib/action_dispatch/middleware/cookies.rb @@ -115,10 +115,13 @@ module ActionDispatch @delete_cookies = {} @host = host @secure = secure + @closed = false @cookies = {} end - alias :closed? :frozen? + attr_reader :closed + alias :closed? :closed + def close!; @closed = true end # Returns the value of the cookie by +name+, or +nil+ if no such cookie exists. def [](name) @@ -327,7 +330,7 @@ module ActionDispatch [status, headers, body] ensure cookie_jar = ActionDispatch::Request.new(env).cookie_jar unless cookie_jar - cookie_jar.freeze + cookie_jar.close! end end end |