Rails CookieStore::CookieOverflow, not for all users, only in production

1.3k views Asked by At

I have a couple users that are getting this CookieStore::CookieOverflow error.

I'm suspicious of nginx/passenger because I just switched to that last week (from nginx/thin) and now these are happening.

It's always a particular action, but it doesn't happen for all users. I checked to see what I'm storing in the session and I'm not saving any large objects, just a couple ids and a couple boolean values.

If I were storing big objects in the session, I'd expect all users to have this error.

Suggestions on how to troubleshoot this would be helpful.

2

There are 2 answers

0
wesgarrison On BEST ANSWER

Three Date objects stored in the session were causing this. Removing them from the session stopped the error from happening.

0
Simone Carletti On

Tracking and debugging a CookieStore::CookieOverflow error it's not simple. You should try to replicate exactly the same user activity on the site.

A couple of suggestions to fix the error: * switch to a more scalable cookie storage such as ActiveRecord or Memcached * try to reduce the number of elements stored in session

Also note that flash messages are stored in session. If you send back a really long flash message text you might expect a CookieOverflow error.