[Zope] Session to session id to session (_ZopeId)

Peter Bengtsson peterbe at gmail.com
Thu Oct 21 08:25:18 EDT 2004


I see. It's not the session id I'm after, it's the browser hook id
that looks like this:
28010048A1iovKNvhGY

I want to use SESSIONs in XML-RPC. I thought reading this advice from
Jim Washington (
http://mail.zope.org/pipermail/zope/2004-August/152576.html) would
solve all my problems but it didn't work. Have only tested in
Zope2.6.2.

It appears the session_id_manager keeps generating new browser id's
instead of letting me reuse the one I have an id for.
I've tried the following code in the method that takes the session
browser id for a parameter::


 print _zopeid
 self.REQUEST.set('_ZopeId', _zopeid)
 print self.REQUEST.SESSION

But the result is stupidly::

 35536076A1ioxSHjfMw
 id: 10983612680251881408, token: 77363729A1ioxSI7RwA, contents: []

I've also tried::

 print  sessionid
 self.REQUEST.SESSION.getBrowserIdManager().setBrowserIdCookieByForce(sessionid)
 print self.REQUEST.SESSION

But again the result is::

 60658721A1iox6BFVt0
 id: 10983614170647928785, token: 47355912A1iox6CjhWY, contents: []

What can I do with this browser id hook to get my session object back?


On Wed, 20 Oct 2004 20:32:36 +0200, Dieter Maurer <dieter at handshake.de> wrote:
> Peter Bengtsson wrote at 2004-10-20 16:38 +0100:
> > ....
> >        return str(self.REQUEST.SESSION.id)
> >
> >Then in another context but under the same zope instance, this id that
> >mylogin() returns will be passed to another method. That other method
> >should try to get the session object back if not expired. How do I do
> >that?
> 
> You use methods of "Products.Transience.Transience.TransientObjectContainer"
> on the instance at "temp_folder/session_data" (this is the
> "TransientObjectContainer" used for sessions -- until you change
> the configuration).
> 
> Of course, the relevant methods are private (you should not
> look into sessions of other persons). Thus, you can use
> them only from trusted code...
> 
> --
> Dieter
> 


-- 
Peter Bengtsson, http://www.peterbe.com


More information about the Zope mailing list