what happens when cookies file exceeds maximum siz

2019-01-23 23:31发布

What really happens when cookies file exceeds maximum size?

3条回答
时光不老,我们不散
2楼-- · 2019-01-23 23:47

The typical behavior of most browsers, to my knowledge, is to simply truncate the oldest data that does not fit.

For example, create cookies 1 through 9. When creating cookie 10 and the data size is going to overflow, cookie 1 is simply discarded.

In general practice, if you are worried about bumping into the limit and loosing cookies to overflow, it is probably time to rethink your strategy of what you are storing and start caching the data server-side and limiting the cookie to a value to access the cached data.

查看更多
混吃等死
3楼-- · 2019-01-23 23:49

I think that would be browser dependent, since RFC2965 does not define a maximum size for cookies or any standard behavior for when the maximum is exceeded.

查看更多
Melony?
4楼-- · 2019-01-23 23:51

The file is truncated to the maximum length.

查看更多
登录 后发表回答