[Zope] Re: HappySession

Hung Jung Lu hungjunglu@hotmail.com
Fri, 01 Sep 2000 08:15:11 PDT

>From: "Philipp Auersperg" <zope@philosoft.at>
>I also use HappySession and when catching the SessionNotFoundError
>weird things happen:
>here my  code:
>    <dtml-call "SESSION.set('FLinkID','0')">
>session error!
>When the session is expired the error is not caught correctly and I get the 
>error mentioned below. Plus, I have to restart my server because ZODB 
>reports a transactional error and sets itself to read-only.

I would guess you have the same problem as Diego Rodrigo... could you check 
your standard_html_header? Does it make any reference to SESSION?

One thing about HappySession is that I made it so no initialization is 
required. So please do not call SESSION object in standard_html_header to 
initialize it. (In the next release I'll make it safe even if someone calls 
it in standard_html_header.)

I will try to guess what you want to do: you want to initialize FLinkID at 
the beginning of the session? If so, since HappySession's dictionary does 
not require initialization, you can do something like:

  <dtml-if "SESSION['FLinkID'] == _.None">
    <dtml-call "SESSION.set('FLinkID', 0)">
    ... normal operation here ...

(If an item does not exist, SESSION['FLinkID'] returns ._None)


Hung Jung

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

Share information about yourself, create your own public profile at