# Auth0 Access Token Size is 1334 and causing CookieOverflow Exception in Rails 7 Application

**URL:** <https://community.auth0.com/t/auth0-access-token-size-is-1334-and-causing-cookieoverflow-exception-in-rails-7-application/151683>\
**Category:** Get Help\
**Tags:** application, sso\
**Created:** [November 16, 2024, 9:04pm UTC](https://community.auth0.com/t/auth0-access-token-size-is-1334-and-causing-cookieoverflow-exception-in-rails-7-application/151683 "2024-11-16T21:04:38Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![dwood1](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/dwood1/32/60033_2.png) [@dwood1](https://community.auth0.com/u/dwood1)\
**Post date:** [November 16, 2024, 9:04pm UTC](https://community.auth0.com/t/auth0-access-token-size-is-1334-and-causing-cookieoverflow-exception-in-rails-7-application/151683/1 "2024-11-16T21:04:38Z")

</div>

My team and I are currently upgrading our auth0 based sso application to rails 7 and the access token coming back is too large to store in the cookie with the other elements. We do have custom claims and I noticed that auth0 once had a fixed access token setting that would keep the size of the token down to a minimum. Right now, on redirect the token is 4336 bytes in total with all required data. Of course we need to be underneath 4,000 bytes. What can we do to fix this issue, as its a blocker for our mandatory upgrades?

---

<div class="post-metadata">

**Author:** ![nevosus](https://upload.wikimedia.org/wikipedia/commons/thumb/7/7c/User_font_awesome.svg/768px-User_font_awesome.svg.png) [@nevosus](https://community.auth0.com/u/nevosus)\
**Post date:** [November 20, 2024, 9:49pm UTC](https://community.auth0.com/t/auth0-access-token-size-is-1334-and-causing-cookieoverflow-exception-in-rails-7-application/151683/2 "2024-11-20T21:49:44Z")

</div>

If you check the token, is most of it the custom claim? Auth0 won’t be able to do much if this is the case. Can you share an example of a token you have? (without the signature)

Some tips:

- Try to encode values as much as possible, e.g. reduce long names with abbreviations.
- If you have a long list of values and they are static, you can use a bitmap to represent them.

---

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/auth0/original/3X/b/5/b560f266932fcce5d57f09a6595bd50518cae3f3.jpeg) [@system](https://community.auth0.com/u/system)\
**Post date:** [January 3, 2025, 2:58pm UTC](https://community.auth0.com/t/auth0-access-token-size-is-1334-and-causing-cookieoverflow-exception-in-rails-7-application/151683/3 "2025-01-03T14:58:09Z")

</div>

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