[Zope] FSSession trouble

Peter Bengtsson mail@peterbe.com
Fri, 8 Jun 2001 12:11:23 +0200


I have problems with the FSSession product (0.4.2)
http://www.zope.org/Members/gaaros/FSSession

Firstly, I rename the FSSession object to prevent naming confusion.

------ index_html ---------------------------

<dtml-call changesSession>
<dtml-var "_.str(changesSession)">
<!-- this returns:
   oldvariablesinceyesterday = "peppe"
 -->
<dtml-call "changesSession.set('name','peter')">
<dtml-var "_.str(changesSession)">
<!-- this returns:
   oldvariablesinceyesterday = "peppe"
   name = "peter"
 -->
<dtml-call changesSession>
<dtml-var "_.str(changesSession)">
<!-- this returns:
   oldvariablesinceyesterday = "peppe"
 -->
------ /index_html ---------------------------

Did you see what happened?? I lost a variable I managed to set as a cookie
when calling the FSSession object again towards the bottom!
Why this? How to prevent it?

What I do in reality (the above pseudo) is that in standard_html_header I
call the FSSession object and then use it to display custom Stylesheets.
Then I call the FSSession object again to use it in standard_html_footer to
use it to display different footers.

The <dtml-call FSSession> is vital to be able to begin to use it, but why
isn't it enough just to do it once in standard_html_header in a code like
this:
<dtml-var standard_html_header>
<h1>A Page</h1>
<dtml-var standard_html_footer>

One simple alternative is to set a REQUEST variable in standard_html_header
and use that instead of using the object in the standard_html_footer


Welcoming some Zopezen

Peter