[Zope] Session Mgmt. with Session Id Manager

Geir Bækholt Geir Bækholt <geirh@funcom.com>
Wed, 10 Apr 2002 14:48:07 +0200


Not a how-to , but a quick summary of something that works at least..
should get you started enough, so the Zope-help will start being
useful...



the Data-mangers and related items you need should be instantiated by
default in Zope2.5 at least, so you dont have to add anything by
hand..

i quit using DTML the second ZPT1.0 was out , so i have no examples
there , but in ZPT , i list all session contents like this :
<div class=3D"debugdata"
           tal:condition=3D"exists:request/SESSION">
           <p><b>SESSION contains:</b></p>
           <p tal:repeat=3D"keys python:request.SESSION.keys()"><span tal:r=
eplace=3D"keys" /> : '<span tal:replace=3D"python:request.SESSION[keys]" />'
           </p>
</div>

and usually add stuff to the session in a python script  , this way :
SESSION =3D context.REQUEST.SESSION
SESSION.set('somekey',somevariable)

i am not certain , but i think you have to establish the session by
calling:
context.browser_id_manager.getBrowserId(create=3D1)

...
that would be just:
browser_id_manager.getBrowserId(create=3D1)
in DTML




on or about, Wednesday, April 10, 2002, we have reason to believe that Schm=
idt, Allen J. wrote something along the lines of :
SAJ> Nice, but not very helpful I found. A simple HowTo would have helped m=
ore.=20

SAJ> We have been using SQLSession for a while and its been working well bu=
t we
SAJ> feel there may be issues with Squid and ZEO and many ZEO clients on
SAJ> different boxes. And, se figured since  the new Sessioning stuff is bu=
ilt
SAJ> in, maybe now is a good time to switch.

SAJ> So, the questions:

SAJ> Which of the session-type things need to be added where=3F Data Manage=
rs, ID
SAJ> managers, Transient containers=3F=3F

SAJ> In SQLSession, I *dtml-call Session* at the top of every page that wil=
l use
SAJ> sessions (in standard_header) and then use *dtml-call
SAJ> SESSION.set(name,value)* and *dtml-var SESSION['name']* whenever I wan=
t to
SAJ> set or get something from the session.

SAJ> Does anyone have specifics on how to do this simplest of things with t=
he new
SAJ> Sessioning tools=3F

SAJ> Thanks!!!!

SAJ> -Allen

SAJ> -----Original Message-----
SAJ> From: Geir B=E6kholt [mailto:geirh@funcom.com]
SAJ> Sent: Wednesday, April 10, 2002 7:22 AM
SAJ> To: Marc Ende
SAJ> Cc: zope@zope.org
SAJ> Subject: Re: [Zope] Session Mgmt. with Session Id Manager



SAJ> The help interface inside Zope actually has nice documentation on
SAJ> sessions....

SAJ> :-)

SAJ> hth

SAJ> on or about, Wednesday, April 10, 2002, we have reason to believe that=
 Marc
SAJ> Ende wrote something along the lines of :
ME>> Hi there,

ME>> I've tried to use Sessions on my zope-site for authentication
SAJ> features...
ME>> Is there any good documentation about the session data manager and
ME>> the browser id manager. I've been searching the whole night but I've
SAJ> only
ME>> found sql - sessionmanager, happy... etc. etc.... But I haven't found a
SAJ> good
ME>> docu about the included one. (Even the ZopeBook doesn't tell much about
ME>> sessions)

ME>> cheers

ME>> marc







--=20
Geir B=E6kholt                      web-developer
geirh@funcom.com             funcom oslo | webdev-team