W3C home > Mailing lists > Public > whatwg@whatwg.org > April 2005

[whatwg] Some likeness of DOM Session scope

From: Kornel Lesinski <kornel@ldreams.net>
Date: Thu, 21 Apr 2005 15:13:01 +0100
Message-ID: <op.spk5rziu602458@idlaptop02.ideadesigners.local>
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

This archive was generated by hypermail 2.4.0 : Wednesday, 22 January 2020 16:58:40 UTC