Hey, when assigning multiple tenants to the same u...
# ask-a-descoper
t
Hey, when assigning multiple tenants to the same user, sometimes if there are many tenants, the user gets stuck on the "choose tenant flow." I couldn't find any audit logs related to this issue. We are able to reproduce it.
project id
P2mvO2smJcUY5UZ4n6qnK3Pnu7OT
d
From our docs (Ask AI): Cookie size issues occur because Descope stores custom claims in the refresh token, and browsers limit cookies to 4KB.(1) Limits: • Each key: max 60 characters(1) • Each claim value: max 500 characters(1) • Each JWT: max 100 keys(1) Solutions: 1. Reduce custom claims - Avoid storing too much data in JWTs to prevent storage limitations.(1) 2. Switch to response body management - Instead of storing tokens in cookies, configure your project to return tokens in the API response body.(2) This removes the 4KB cookie size constraint.(2) 3. Use localStorage - The SDK can store tokens in localStorage instead of cookies by not setting
sessionTokenViaCookie
.(3)(4) Note: If your session token stays small (less than 1KB),
sessionTokenViaCookie
works fine.(3) Session tokens grow when using authorization or adding custom claims.(4)
So basically it happens because the cookie size reached the limit the browser supports and the cookie is not sent.
t
🙏