module

ActionController::Cookies

No documentation available for this module.

Included modules

  • RackDelegation

Files

  • actionpack/lib/action_controller/metal/cookies.rb

2Notes

Writing and reading a cookie in the same request.

jmcnevin · Jul 29, 20088 thanks

Note that when setting the value of a cookie, the new value won't be accessible until the next page request. In this way, the cookies hash cannot be used in the same manner as the session hash.

For example:

given that cookies[:temporary_data] was set to 'foo' in the previous request

cookies[:temporary_data] = 'bar' p cookies[:temporary_data] # => 'foo'

Writing and reading a cookie in the same request.

Olly · Jun 3, 20093 thanks

As of 0349278f3da9f7f532330cf295eed35ede3bae66 cookie updates will persist in the current request.