Why are my JSON cookies sometimes distorted

We use a cookie for some insensitive convenience data about visitors to our site. We emit three values: 1) creation date (in ticks), 2) user data, JSON serialized, 3) hash validation

We see that only half of the cookie is included in the number of requests. They contain the full date and truncated user data, something like {"Foo": false, "Bar": 0

This is a large site, and the number of bad cookies is about 1-3 per minute (out of 8-10 thousand page requests per minute).

Does anyone experience something like this? I am wondering if we have a browser that does not like JSON, or maybe the header is truncated by some browsers, or there may be a JSON serializer error. We use JavaScriptSerializer in .NET 3.5.

+1
source share
1 answer

Uncoded inline commas and over stuffed cookies are typical causes of this behavior.

+1
source

Source: https://habr.com/ru/post/1734559/


All Articles