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 = session.data.clone
reset_session
rollback.each { |k, v| session[k] = v unless k.is_a?(String) && k =~ /^as:/ }
end

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

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s