From: "Philipp Auersperg" <zope@philosoft.at>
I also use HappySession and when catching the SessionNotFoundError weird things happen: here my code:
<dtml-try> <dtml-call "SESSION.set('FLinkID','0')"> <dtml-except> session error! </dtml-try>
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)"> <dtml-else> ... normal operation here ... </dtml-if> (If an item does not exist, SESSION['FLinkID'] returns ._None) regards, 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 http://profiles.msn.com.
Hi! I do not have any reference to HappySession in my headers. I enclosed the session.set(..) in <dtml-try> in order to catch the SessionNotFoundError, your slution just tests if the item exists in the session but does it prevent from the SessionNotFoundError exception? thanks phil *********** REPLY SEPARATOR *********** On 01.09.2000 at 08:15 Hung Jung Lu wrote:
From: "Philipp Auersperg" <zope@philosoft.at>
I also use HappySession and when catching the SessionNotFoundError weird things happen: here my code:
<dtml-try> <dtml-call "SESSION.set('FLinkID','0')"> <dtml-except> session error! </dtml-try>
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)"> <dtml-else> ... normal operation here ... </dtml-if>
(If an item does not exist, SESSION['FLinkID'] returns ._None)
regards,
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 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 )
participants (2)
-
Hung Jung Lu -
Philipp Auersperg