[Zope] SQLSession and RESPONSE.redirect
Andrew Williams
ajwms@visto.com
Thu, 22 Feb 2001 15:28:16 -0800
Anyone:
I've just run across something interesting and I'm not sure=20
if this is by design. Consider the following in a DTML=20
Document:
---------------------------------------------------------
<dtml-call Session> #SQLSession instance
<dtml-if "REQUEST.has_key('blah')">
<dtml-if "REQUEST.has_key('test')">
<dtml-call "SESSION.set('test',test)">
</dtml-if>
<dtml-call "RESPONSE.redirect('nextpage')">
</dtml-if>
<dtml-var standard_html_header>
<dtml-if "SESSION.has_key('test')">
<dtml-call "SESSION.delete('test')">
</dtml-if>
=2E.bunch of dtml/html
<dtml-var standard_html_footer>
---------------------------------------------------------
ok. So, when I wrote this, I figured that:
when 'blah' exists, and 'test' exists, it will=20
store 'test' in my mySQL database and then redirect=20
to 'nextpage'...
however, if 'blah' does not exist, then the document will=20
be display, and if 'test' is stored as a SQLSession=20
variable, then 'test will get deleted from the database...
confused yet?
Check this out... everything works as figured, *except*=20
AFTER the response.redirect, the code:
<dtml-if "SESSION.has_key('test')>
<dtml-call "SESSION.delete('test')>
</dtml-if>
runs, effectively deleting test from the database after the=20
RESPONSE.redirect.
I've checked, double, and triple checked... I know this is=20
happening, b/c if I remove the session.delete code 'test'=20
is in the db.
Am I crazy, or is this by design?
Any info would be greatly appreciated.
Andrew Williams <scratching his head...>
=20
_________________________________________________________________________=
__
Visit http://www.visto.com/info, your free web-based communications cente=
r.
Visto.com. Life on the Dot.