Shared objects compared with cookies
Cookies and shared objects are very similar. Because most web programmers are familiar with how cookies work, it might be useful to compare cookies and local SharedObjects.
Cookies that adhere to the RFC 2109 standard generally have the following properties:
- They can expire, and often do at the end of a session by default.
- They can be disabled by the client on a site-specific basis.
- There is a limit of 300 cookies total, and 20 cookies maximum per site.
- They are usually limited to a size of 4 KB each.
- They are sometimes perceived to be a security threat, and as a result, they are sometimes disabled on the client.
- They are stored in a location specified by the client browser.
- They are transmitted from client to server through HTTP.
In contrast, shared objects have the following properties:
- They do not expire by default.
- By default, they are limited to a size of 100 KB each.
- They can store simple data types (such as String, Array, and Date).
- They are stored in a location specified by the application (within the user's home directory).
- They are never transmitted between the client and server.
本文对比了Cookie与共享对象的特点,介绍了它们各自的属性,如有效期、大小限制、存储位置及传输方式等。对于熟悉Cookie的开发者来说,了解共享对象的工作原理及其与Cookie的区别将有助于更好地选择合适的数据存储方案。
1万+

被折叠的 条评论
为什么被折叠?



