This one has been puzzling me for some weeks now. The following checkCookie code is included in the standard_html_header. If the browser has the cookie key, then get the value. If not, then create the cookie, and store it in a session table ( via ODBC ). Using 1.11pr1, NT, and ODBC name: checkCookie <!--#if "REQUEST.cookies.has_key('CK_Session')"--> <!--#call "REQUEST.cookies['CK_Session']"--> <!--#else--> <!--#call "REQUEST.set('CK_SessionID', _.str(ZopeTime().timeTime()) )"--> <!--#call "RESPONSE.setCookie('CK_Session', CK_SessionID)"--> <!--#in "add_session(m_sessid=CK_SessionID)"--> <!--#/in--> <!--#call "REQUEST.set('CK_Session', CK_SessionID)"--> <!--#/if--> Now this will fail with an error only the very first time this function ( or permutations of this ) is called after Zope is started up. I can close the browser down, and start a new browser session, and it will then work without error. Here's the traceback I get: Traceback (innermost last): File f:\zope\lib\python\ZPublisher\Publish.py, line 255, in publish_module File f:\zope\lib\python\ZPublisher\Publish.py, line 157, in publish File f:\zope\lib\python\ZPublisher\mapply.py, line 154, in mapply (Object: index_html) File f:\zope\lib\python\ZPublisher\Publish.py, line 98, in call_object (Object: index_html) File f:\zope\lib\python\OFS\DTMLMethod.py, line 158, in __call__ (Object: index_html) File f:\zope\lib\python\OFS\DTMLMethod.py, line 154, in __call__ (Object: index_html) File f:\zope\lib\python\DocumentTemplate\DT_String.py, line 514, in __call__ (Object: index_html) File f:\zope\lib\python\OFS\DTMLMethod.py, line 150, in __call__ (Object: standard_html_header) File f:\zope\lib\python\DocumentTemplate\DT_String.py, line 514, in __call__ (Object: standard_html_header) File f:\zope\lib\python\OFS\DTMLMethod.py, line 150, in __call__ (Object: checkCookie) File f:\zope\lib\python\DocumentTemplate\DT_String.py, line 514, in __call__ (Object: checkCookie) File F:\zope\lib\python\DocumentTemplate\DT_In.py, line 620, in renderwob (Object: add_session(m_sessid=CK_SessionID)) File f:\zope\lib\python\DocumentTemplate\DT_Util.py, line 315, in eval (Object: add_session(m_sessid=CK_SessionID)) File <string>, line 0, in ? File f:\zope\lib\python\Shared\DC\ZRDB\DA.py, line 388, in __call__ (Object: add_session) AttributeError: (see above) ------- Regards, Graham Chiu gchiu<at>compkarori.co.nz
Graham Chiu wrote:
Now this will fail with an error only the very first time this function ( or permutations of this ) is called after Zope is started up. I can close the browser down, and start a new browser session, and it will then work without error.
Here's the traceback I get:
Traceback (innermost last):
<snip>
AttributeError: (see above)
Which attribute is causing the error? This should also be included in the error page above the traceback. -Michel
------- Regards, Graham Chiu gchiu<at>compkarori.co.nz
_______________________________________________ Zope maillist - Zope@zope.org http://www.zope.org/mailman/listinfo/zope
(To receive general Zope announcements, see: http://www.zope.org/mailman/listinfo/zope-announce
For developer-specific issues, zope-dev@zope.org - http://www.zope.org/mailman/listinfo/zope-dev )
In article <37A0C72D.A40ED940@digicool.com>, Michel Pelletier <michel@digicool.com> writes
AttributeError: (see above)
Which attribute is causing the error? This should also be included in the error page above the traceback.
-Michel
Sorry, here's the other part <H2>Zope Error</H2> <P>Zope has encountered an error while publishing this resource. </P> <P> <STRONG>Error Type: AttributeError</STRONG><BR> <STRONG>Error Value: query</STRONG><BR> And here's the zsql add_session that it is complaining about: insert into session ( sessid, attempts ) values ( <!--#sqlvar m_sessid type=nb-->, 0 ) ------- Regards, Graham Chiu gchiu<at>compkarori.co.nz
In article <37A0C72D.A40ED940@digicool.com>, Michel Pelletier <michel@digicool.com> writes
AttributeError: (see above)
Which attribute is causing the error? This should also be included in the error page above the traceback.
Any ideas yet on why this error occurs?? ------- Regards, Graham Chiu gchiu<at>compkarori.co.nz
participants (2)
-
Graham Chiu -
Michel Pelletier