ActionDispatch::Cookies::CookieOverflow error with 2 Devise models

285 views
Skip to first unread message

Dude (Abides)

unread,
Apr 6, 2014, 7:22:52 PM4/6/14
to plataforma...@googlegroups.com
Hi, I'm building an ecommerce app with a login for customers, another for admin.

So I have 2 Devise models - customers and admin.

When I login with customers or just admin, everything works fine.

However in the same browser storing in the same cookie if I login as a customer AND as admin I get the following error on the second login:

 ActionDispatch::Cookies::CookieOverflow

So it seems 2 logins on 2 models, same browser, storing in same cookie leads to a CookieOverflow error message, i.e. I've exceeded the 4k cookie limit.

I looked on Stack Overflow and the common solution recommended to this issue is use a different store. This app is in Rails 4.

Is there a way to get around this without having to use the db or memcache as the store. Thanks in advance for any pointers.

Ezequiel Delpero

unread,
Apr 8, 2014, 4:25:26 PM4/8/14
to plataforma...@googlegroups.com
A quick solution could be to open another instance of your browser in private mode or instead of adding an Admin model, you could add an admin boolean field to your user model and check for that attribute when trying to access to the admin cms.

Hope it helps.

Regards.
Reply all
Reply to author
Forward
0 new messages