puppetlabs/puppet-dashboard — pull request #168 by kbarber (2013-01-23 15:58:34+00:00)
Title: (#17914) Store FlashHash as a normal Hash in session

This patch is a backport of:

https://github.com/rails/rails/commit/36376560fdd02f955ae3bf6b7792b784443660ad

In the form of a monkey patch in the puppet-dashboard initializer stage.

This is required to allow puppet-dashboard to co-exist with other applications
that do not have the full rails stack in their namespace. Without it, other
non-rails applications (such as the certificate service and live management)
are unable to unmarshal cookies created in Rails. Instead, they invalidate the
session and we start to see weird authentication glitches in the GUI.

In essence this patch ensures that when the FlashHash data is stored in a cookie
it is stored as a normal Ruby Hash, as apposed to an
ActionController::Flash::FlashHash. As all other Ruby applications should be
able to unmarshal a Hash, this will avoid the Marshal.load method in
Rack::Session::Cookie from throwing a NameError exception.

Signed-off-by: Ken Barber