Shrinking cookie size?

Hello! We’re using Lock to manage our logins, and for our external users it seems to work fine. When I try to log into our ActiveAdmin with Google, though, I get a ActionDispatch::Cookies::CookieOverflow error. Looking into the session dump on that page, the same long string is stored in adminjwt and id_token, and the information that string encodes is presented “plainly” in the dump as well. Would all that be stored in the cookie? (The dump is about 6.5K, above the 4K limit). How can I reduce that redundancy?

I tried changing auth.responseType from token id_token to just token, but there was no effect. I also found this page, but I’m not sure I’m able to mess with the database, as I’m the only one around here having this issue. Thanks for any ideas you have.

Hey @tlhinman,

Are you using rails? If so, have you looked at this guidance:

ActionDispatch::Cookies::CookieOverflow

This error means that a cookie session is being used and because the whole profile is being stored, it overflows the max-size of 4 kb. If you are unable to access the user profile and you get an error similar to NoMethodError , undefined method '[]' for nil:NilClass , try using In-Memory store for development.

Go to /config/initializers/session_store.rb and add the following:

Rails.application.config.session_store :cache_store

Was this helpful?Yes/No

Go to /config/environments/development.rb and add the following:

config.cachestore = :memorystore

Was this helpful?Yes/No

It is recommended that a memory store such as MemCached being used for production applications.

https://auth0.com/docs/quickstart/webapp/rails/01-login#actiondispatch-cookies-cookieoverflow

Let me know.

Thanks,
Dan

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.