[Zope] Persistent login

Dieter Maurer dieter@handshake.de
Tue, 9 Jul 2002 19:10:06 +0200


Thierry Florac writes:
 > I'd like to keep authentication values persistent in a session, so that
 > authentication values can be visible while accessing non protected
 > documents or methods.
 > I tried to do this in a Python script :
 > 
 >   request = context.REQUEST
 >   session = request['SESSION']
 >   session['AUTHENTICATED_USER'] = request['AUTHENTICATED_USER']
 > 
 > but then I receive an error message : 
 >   Error Type: UnpickleableError
 >   Error Value: Cannot pickle objects
"request['AUTHENTICATED_USER']" is a complex object which cannot
be stored inside ZODB.

When you want to store the user name, use "request['AUTHENTICATED_USER'].getUserName()".


Dieter