[whatwg] Some likeness of DOM Session scope

On Thu, 21 Apr 2005 14:07:45 +0100, Ian Hickson <ian at hixie.ch> wrote:

> Anyone have any concrete proposals? :-)

Persistent associative array that stores anything*, just like session  
object
in PHP and ASP.

This might be called:
document.localCookies

Scope would be just like in HTTP cookies, but these wouldn't be sent to  
the server and wouldn't have length limit.

To store object:
document.localCookies['key_name'].value = anything;

To retrieve object:
anything = document.localCookies['key_name'].value;

* only /Storable/ objects should be allowed. Storable objects are the ones
that implement "sleep" and "wake" methods that (un)serialize them.
That would be save/load XML for DOMNodes, toString/parseInt/etc for basic  
types.


-- 
regards, Kornel Lesinski

Received on Thursday, 21 April 2005 07:13:01 UTC