当Cookie文件超过最大大小时会发生什么? [英] what happens when cookies file exceeds maximum size?

查看:259
本文介绍了当Cookie文件超过最大大小时会发生什么?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当Cookie文件超过最大大小时,会发生什么?

What really happens when cookies file exceeds maximum size?

推荐答案

据我所知,大多数浏览器的典型行为

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

例如,创建cookie 1到9.当创建cookie 10并且数据大小将溢出时,cookie 1

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

在一般的做法中,如果你担心会碰到限制,并失去cookie溢出,可能是时候重新考虑你的策略存储并开始缓存数据服务器端,并将cookie限制为访问缓存数据的值。

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.

这篇关于当Cookie文件超过最大大小时会发生什么?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆