[Zope] Re: FSSession newbie problem

Hung Jung Lu hungjunglu@hotmail.com
Thu, 08 Jun 2000 15:05:14 PDT


--- In zope@egroups.com, Marcello Lupo <lupo@a...> wrote:
>and macically i obtain the same error.
>this is the code i used:
><dtml-call FSSession>
><dtml-unless "FSSession.has_key('cart')">
><dtml-call "FSSession.set('cart',{})">
></dtml-unless>
>
><dtml-call "FSSession['carrello'].update(REQUEST.form)">

I have tried your code with 'cart' everywhere, and it worked just fine. Can 
you print out the form variables?  Are all the statements inside the same 
DTML file? It really works fine. Also, make sure that FSSession is in a 
parent folder of your DTML method. (Root folder is usually a good idea.) Is 
your machine cookie-enabled?

====================================================
<dtml-var standard_html_header>
<dtml-call FSSession>
<dtml-unless "FSSession.has_key('cart')">
  <dtml-call "FSSession.set('cart',{})">
</dtml-unless>
<dtml-call "FSSession['cart'].update(REQUEST.form)">
<dtml-var "FSSession['cart']">
<dtml-var standard_html_footer>
====================================================

If you still have problems, you can try SQLSession or HappySession. For 
beginners I would recommend HappySession so you don't need to worry about 
the details of FSSession or SQLSession.

Download HappySession from
http://www.zope.org/Members/hungjunglu/Products/HappySession

Add an HappySession instance in your Zope hierarchy. Then try:

====================================================
<dtml-var standard_html_header>
<dtml-unless "SESSION.has_key('cart')">
  <dtml-call "SESSION.set('cart',{})">
</dtml-unless>
<dtml-call "SESSION['cart'].update(REQUEST.form)">
<dtml-var "SESSION['cart']">
<dtml-var standard_html_footer>
====================================================

regards,

Hung Jung

________________________________________________________________________
Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.com