[Zope] Core Session Tracking kudos & namespaces

Dieter Maurer dieter@handshake.de
Thu, 4 Jan 2001 21:18:49 +0100 (CET)


Chris McDonough writes:
 > So the question becomes: do we want DTML namespace lookup magic or no DTML
 > namespace lookup magic for names that we attempt to look up in a session
 > data object? ....
Maybe, we do not want the magic automatically but have
a simple way to call for it, when we like.

I think exposing the SessionData keys as attributes (in addition
to exposing them as mapping keys) is a good thing.

It allows to use:

   <dtml-XXXX expr="... sessionData.a ..."

as well as

   <dtml-with sessionData>
     <dtml-var a>
   </dtml-with>

i.e. place them in the DTML namespace, if we think they should go
there.

As said in an earlier message, it would be possible to
bring them in the DTML namespace, if they would implement
Python's mapping interface. In this case, we could use

  <dtml-with sessionData mapping>
     <dtml-var a>
  </dtml-with>


We now use "FSSession" which implements the full Python mapping
interface. We can use <dtml-with FSSession mapping>, if
we think this is good.

Usually, however, we put all relevant session data into
REQUEST.form and REQUEST.other in setup code
and allow the main code not to worry about session handling
at all.


Dieter