[Zope] Using "Session" to store per-session data.

Tony McDonald tony.mcdonald@ncl.ac.uk
Mon, 13 Sep 1999 14:27:11 +0100


At 7:37 am -0400 13/9/99, Paul Everitt wrote:
>Tony McDonald wrote:
>> A plug for my  *old* language, PHP3 and its session library PHPLIb.
>> They did it using cookies and an SQL database, and I think that's the
>> way to do it, rather than using the ZODB.
>> The PHPLib library is at: http://phplib.netuse.de/index.php3
>
>I wonder why you think the ZODB isn't the place to do this?

Really because I'm understanding the situation to be somewhat akin to 
the 'counter' problem. I may well be misguided in that, and am 
probably misusing the ZODB because of it (I'm using it for holding 
DTML objects, External methods and ZSQL methods mainly). The other 
reason is that I don't understand enough about the Storage class you 
mention.

>If it is because of the versioning issue:
>
>1) You can create a special datastructure that doesn't version on every
>commit, but instead perhaps every minute.  Think of it as halfway
>between volatile and persistent.
>
>2) One of these days we'll come out with a non-versioning Storage class,
>plus allow people to mix Storages in the same process.

This would be highly useful - the PHPLIb libraries were invaluable to 
me when I was working with PHP (holding variables across sessions, 
and authentication being the main reasons I used the library).

>3) Then again, perhaps people could live with the 20 byte or so growth
>on each Session commit.

That doesn't seem *too* high a price to pay.
cheers,
Tone.
------
Dr Tony McDonald,  FMCC, Networked Learning Environments Project 
http://nle.ncl.ac.uk/
The Medical School, Newcastle University Tel: +44 191 222 5888
Fingerprint: 3450 876D FA41 B926 D3DD  F8C3 F2D0 C3B9 8B38 18A2