Whilst trying to access cookie values that had been set in the current request in the view, I discovered that a new CookieJar is instantiated with every call to ActionController::Base#cookies.
Obviously in standard HTTP requests cookies can only be retrieved in subsequent requests to the one they were set in. However the code for CookieJar seems to suggest that the intention was to be able to access the cookies immediately after they had been set, as CookieJar is a sub-class of Hash.
Because a new CookieJar is instantiated with each access, any changes are discarded.
What do people think the intended behavior is? We could easily keep the changes to the cookie jar, by only instantiating one CookieJar per request. The following code in my ApplicationController, changes the behavior to the later: http://gist.github.com/107595