[Zope] Temporary Folder Content - Session Data
Milos Prudek
prudek at bvx.cz
Fri Sep 26 12:42:53 EDT 2003
> Session data containers contain session data objects, each of which
> should be unique for a particular browser (user). It's true that each
> developer will share the same session namespace for a given user, but
> you don't need to limit yourself to storing string-valued key-value
> pairs in the top-level namespace of the session data object. For
> example, instead of:
>
> context.REQUEST.SESSION['avariable'] = 'avalue'
>
> ... you can do something like this:
>
> my_app_namespace = context.REQUEST.SESSION.get('my_app', {})
> my_app_namespace['avaraible'] = 'avalue'
> context.REQUEST.SESSION.set('my_app', my_app_namespace)
Is this the only way to have separate session objects in an application?
I tried to place two Session Data Managers in one folder. I tolds the
first of them to Place SESSION in REQUEST object as "ses1", and the
second one to place it as "ses2". Zope seems to use only the first one.
When I listed the REQUEST, it contained "ses1" and "SESSION" (inherited
from default Session Data Managers).
That made me think that I can at least place a new Session Data Managers
hierarchic subfolders and all of them will be visible. A drawing will
easier to understand:
folderA/
SDM1 (place session as "ses1")
folderB/
SDM2 (place session as "ses2")
folderC/
SDM3 (place session as "ses3")
Surprisingly, when I print REQUEST from folderC, there are only two
session objects visible: SESSION and ses3.
Why is this?
--
Milos Prudek
_________________
Most websites are
confused chintzy gaudy conflicting tacky unpleasant... unusable.
Learn how usable YOUR website is! http://www.spoxdesign.com
More information about the Zope
mailing list