[Zope] Q: How to pass session information from outside into Zope?

Martijn Pieters mj@antraciet.nl
Tue, 26 Oct 1999 09:49:12 +0200


At 04:07 26/10/99 , Avus wrote:
>So the Session class handles the session ID (i.e. maps it to a particular
>user, for example), right? Any object to the right of the Session object would
>have to be traversable (is this always the case?).

No, the rest of the objects in the URL will be acquired.

>If I want to keep the site structure, I also want to have the session object
>call the original URL after authenticating.
>
>http://zope.server/Session/0x1234/stuff/info/abc should call the original
>http://zope.server/stuff/info/abc
>so I need some redirector logic as well.

No, acquisition takes care of this. You Session object would acquire the 
stuff object, which will be traversed just the same as if it were the first 
part of the URL. So after processing /Session/0x1234 Zope server will then 
process /stuff/info/abc.

>And then it's easier for the 'calling site' to encode the session id like
>http://zope.server/stuff/info/abc?id=0x123 than to put it in the middle of an
>URL string.
>Is there a way to inherit the capability to handle 'get' (id) parameters in
>random Zope objects?

You will always have to handle any REQUEST information explicitly this way. 
In DTML you could do this by always calling a method that does this, just 
like you'd use standard_html_header.

--
Martijn Pieters, Web Developer
| Antraciet http://www.antraciet.nl
| Tel: +31-35-7502100 Fax: +31-35-7502111
| mailto:mj@antraciet.nl http://www.antraciet.nl/~mj
| PGP: http://wwwkeys.nl.pgp.net:11371/pks/lookup?op=get&search=0xA8A32149
------------------------------------------