Actions happen sequentially in a DTML script, so by doing REQUEST.set('GUID', ZopeTime().timeTime()), it allows other called elements later in the script to see the name "GUID" via the magic dtml name lookup rules. You use REQUEST when you want to refer to the request. You use RESPONSE when you want to refer to the response. I don't think that's what you're asking, but I didn't really understand the question so I'm making something up. ;-) From: "Trevor Toenjes" <zope@toenjes.com> To: "Chris McDonough" <chrism@zope.com>; "Trevor Toenjes" <zope@toenjes.com>; "Oleg Broytmann" <phd@phd.pp.ru>; "Zope@Zope. Org" <zope@zope.org>; "Roger Erens" <rlwm.erens@home.nl> Sent: Thursday, September 06, 2001 10:19 PM Subject: RE: [Zope] Re: reading a cookie from another PATH??
AWESOME! It works ... and I have no idea why? ;) 1. When do you use REQUEST vs. RESPONSE(REQUEST) ? 2. Is REQUEST['GUID'] the trick to place GUID in the namespace for every path? Thanks, -Trevor
Try this instead:
<dtml-call "REQUEST.set('GUID', ZopeTime().timeTime())"> <dtml-call "RESPONSE.setCookie('GUID',REQUEST['GUID'], expires='Wed, 19 Feb 2020 14:28:00 GMT',domain='.bar.com', path='/')">
Or in a Python script:
req = context.REQUEST guid = context.ZopeTime().timeTime() req.set('GUID', guid) req.RESPONSE.setCookie( 'GUID', guid, expires='Wed, 19 Feb 2020 14:28:00 GMT', domain='.bar.com', path='/' )