开发者

Why are my cookies containing JSON occasionally malformed

We're using a cookie for some non-sensitive convenience data about our site visitors.开发者_高级运维 We emit three values: 1) creation date (in ticks), 2) user data, JSON serialized, 3) validation hash

We're seeing a fair number of requests coming in with only half a cookie. They contain the full date and truncated user data, something like {"Foo":false,"Bar":0

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

Anyone experience anything similar? I'm wondering if we have a browser that doesn't like the JSON, or maybe the header is getting truncated by some browsers, or maybe there's a JSON serializer bug. We're using the JavaScriptSerializer in .NET 3.5.


unencoded embedded commas and over stuffed cookies are the typical causes of this behavior

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜