module
v4.2.9 -
Show latest stable
-
2 notes
Register or
log in
to add new notes.
jmcnevin -
July 30, 2008
8 thanks
Writing and reading a cookie in the same request.
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'
Olly -
June 3, 2009
3 thanks
Writing and reading a cookie in the same request.
As of 0349278f3da9f7f532330cf295eed35ede3bae66 cookie updates will persist in the current request.