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


-

3 comments:

Rafael Franco said...

Thanks a lot, you save my day!

Anonymous said...

Thanks a bunch. I couldn't figure this one out.

Rails and ruby are such a pain to debug. This is a perfect example as the traceback tells us nothing about where the error occurs in our code.

Anonymous said...

Danke, I would have never figured that out on my own ;)