[Zope] Persistent login

Thierry Florac thierry.florac@onf.fr
11 Jul 2002 09:58:13 +0200


On Wed, 2002-07-10 at 18:47, Dieter Maurer wrote:
> Thierry Florac writes:
>  > > ...
>  > > "request['AUTHENTICATED_USER']" is a complex object which cannot
>  > > be stored inside ZODB.
>  > ...
>  > I've finally decided to try the ZSession product, which can store
>  > complex objects like AuthenticatedUser. It seems to work as specified
>  > above...
> Be very careful, when you store persistent objects in any cache (a
> session belongs to this type)!
> 
>   They have an implicit reference to a ZODB connection.
>   This reference is valid only during the current request.
>   You may get all sorts of weird errors when the object later
>   tries to use this reference.
> 
> I spend days to locate such an error. It appears as if Zope
> were non-deterministically crashing, telling me that
> "None" does not have attributes, oid being invalid
> and objects being referenced from outside a connection...
> 

Perhaps I'm wrong, but I think that ZSession keep sessions properties in
memory, and don't store them in ZODB.
These sessions are cleared from memory after a given timeout (20 minutes
by default).

Should that be enough to prevent me from the problem you specify above
??

Thierry