Sunday, March 22, 2009

CookierStore::CookieOverflow


/!\ FAILSAFE /!\ Sun Mar 22 23:51:44 -0700 2009
Status: 500 Internal Server Error
ActionController::Session::CookieStore::CookieOverflow


This error is typically due to the user trying to store > 4K of data in the session.

Another source of error is if you try to store $! in flash[:error]


begin
....
rescue
flash[:error] = $!
end


This tries to store the ruby exception object in the flash (which in turn is stored in the cookie) and you will start getting the cookie overflow errors.

The solution is simple

begin
....
rescue
flash[:error] = $!.to_s
end


-