userData 行为通过将数据写入一个UserData存储区(UserData store)来保存数据,userData可以将数据以xml格式保存在客户端计算机上,如果你用的是 Windows 2000 或者 Windows xp,是保存在C:/Documents and Settings/Liming/UserData/文件夹下(如果操作系统不是安装在C盘,那么C就应该是操作系统所在的分区)。该数据将一直存在,除非你人为删除或者用脚本设置了该数据的失效期。userData行为提供了一个比Cookie更具有动态性和更大容量的数据结构。每页的UserData 存储区数据大小可以达到64 Kb,每个域名可以达到640 Kb。userData 行为通过sessions为每个对象分配UserData存储区。使用save和load方法将UserData存储区数据保存在缓存(cache)中。一旦UserData存储区保存以后,即使IE浏览器关闭或者刷新了,下一次进入该页面,数据也能够重新载入而不会丢失。出于安全的考虑,相同协议使用同一个文件夹保存UserData存储区数据。
This is a global object (globalStorage) that maintains multiple PRivate storage areas that can be used to hold data over a long period of time (e.g. over multiple pages and browser sessions).
Specifically, the globalStorage object provides access to a number of different storage objects into which data can be stored. For example, if we were to build a web page that used globalStorage on this domain (developer.mozilla.org) we’d have the following storage object available to us:
globalStorage[’developer.mozilla.org’] - All web pages within the developer.mozilla.org sub-domain can both read and write data to this storage object.
A cookie is a small piece of information stored by the browser. Each cookie is stored in a name=value; pair called a crumb—that is, if the cookie name is “id” and you want to save the id’s value as “this”, the cookie would be saved as id=this. You can store up to 20 name=value pairs in a cookie, and the cookie is always returned as a string of all the cookies that apply to the page. This means that you must parse the string returned to find the values of individual cookies.
Cookies accumulate each time the property is set. If you try to set more than one cookie with a single call to the property, only the first cookie in the list will be retained.
You can use the Microsoft® JScript® split method to extract a value stored in a cookie.