[Zope] Fwd: Re: [Zope] Why do session vars suddenly disappear?

Joachim Werner joachim.werner@iuveno.de
Thu, 28 Sep 2000 02:48:45 +0200


Hello!

> Maybe it's because I don't understand the Zope mechanisms completely yet, 

I think so ;-)


> but I sometimes have a hard time preserving some variable state between one 
> and the other web page.

This is not possible without additional measures. How should Zope know that you
have visited that other web page before? HTTP is a stateless protocol that
doesn't per se keep track of your "session".

Fortunately there are a couple of so-called SESSION management tools to help you
(and in one of the next Zope versions session management will be integrated).

Check for products like HappySession or FS Session. They keep track of the
users (e.g. by using cookies) and make any variables you store to the session
namespace available for later use on other pages.

> This happens most often when I call one dtml-method from another one. If the 
> called dtml-method in its turn also calls some other dtml-method which needs 
> some dtml-var from the first template, almost inevitably a Zope error screen 
> appears with some 'unknown variable' or whatever message.

For this (getting REQUEST variables transported to another method than the one
that was called by the form) there is a procedure that works without sessions.
You can just set the variables in the REQUEST for the next page again:

E.g. you received a "Name" variable:

<dtml-call "REQUEST.set('Name',Name)"> stores the variable to the REQUEST.

> I cannot reproduce this fully yet, maybe in my next mail. The same misery 
> happens when opening a document with frames. The separate frames seem to 
> hold no knowledge of any previously set vars.

see above. For the web server the frameset is just a set of independent HTTP
requests. Only with session tracking by cookies, authentication (logins) or
special session URLs that hold a user-specific ID this can be handled.

> Last but not least with Netscape 6 PR2 there seems to be no session state 
> possible whatsoever, no matter what I tried. Even a simple form is not able 
> to pass on its parameters to the receiving dtml-method.

????

Hope this helped.

Joachim
 
> Help!
> 
> _________________________________________________________________________
> Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.com.
> 
> Share information about yourself, create your own public profile at 
> http://profiles.msn.com.
> 
> 
> _______________________________________________
> Zope maillist  -  Zope@zope.org
> http://lists.zope.org/mailman/listinfo/zope
> **   No cross posts or HTML encoding!  **
> (Related lists - 
>  http://lists.zope.org/mailman/listinfo/zope-announce
>  http://lists.zope.org/mailman/listinfo/zope-dev )
-- 
Iuveno - Smart Communication


Joachim Werner


_________________________________________

Marie-Curie-Straße 6
85055 Ingolstadt

Tel.: +49 841/90 14-325 (Fax -322)
Mobil: +49 179/39 60 327
E-Mail: joachim.werner@iuveno.de/joachim.werner@iuveno-net.de
WWW: www.iuveno.de/www.iuveno-net.de
-------------------------------------------------------

-- 
Iuveno - Smart Communication


Joachim Werner


_________________________________________

Marie-Curie-Straße 6
85055 Ingolstadt

Tel.: +49 841/90 14-325 (Fax -322)
Mobil: +49 179/39 60 327
E-Mail: joachim.werner@iuveno.de/joachim.werner@iuveno-net.de
WWW: www.iuveno.de/www.iuveno-net.de