Open marcopesani opened 1 year ago
This issue poses a significant problem when leveraging the cookie persistence as the growing size of the cookie eventually causes failed requests to application servers with 431 Request Header Fields Too Large errors.
Once a user's cookie gets to this size it can be exceedingly difficult to remedy the situation and restore their access to the application.
When using the Mixpanel SDK's union function to merge a given list with a list-valued group property, for example, when tracking the products seen by the customer, the SDK adds the values to a cookie or local storage without de-duplicating them. This can cause the cookie to become very large, surpassing the 4096 bytes limit.
Can be observed here: Bitrefill website I enabled
localStorage
as persistence storage to not crash NGINXSteps to Reproduce:
mixpanel.people.union('pages_visited', 'homepage');
Expected Behavior:
Actual Behavior:
Notes:
Environment:
Mixpanel SDK version:
2.45.0
Browser and version:Google Chrome 108.0.5359.124 (arm64)
Operating system:Mac OS Ventura 13.0.1 (22A400)