Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我发现 angularjs 在使用 $cookieStore.put/get 时会进行序列化和反序列化,并且我可以将整个对象放入其中。那么尺寸限制是多少呢?4kb?
cookie 大小为 4kb。如果您的对象小于该对象,您将能够添加整个对象。请记住,4kb 用于整个 cookie,包括名称、到期时间和值。但 cookie 可能不适合存储对象。请考虑使用 html5 localStorage,除非您 100% 确定希望它在 cookie 中。