Resolve Cookie overflow in rails

Sometimes we need long flash notice message which is unable to handle by rails and yields cookies overflow error to over come this  patch with this method.

put this …

before filter :make_session_clear

def make_session_clear
rollback =
rollback.each { |k, v| session[k] = v unless k.is_a?(String) && k =~ /^as:/ }

That’s it you are up and running…..