Sorry, I had removed it and was hoping it wasn't going to be important, I got an AttributeError: 'Traceback (most recent call last):\n', ' File "C:\\Program Files\\ESOPPlone\\Data\\Extensions\\externalMethods.py", line 172, in removeRequest2\n del REQUEST.form[item]\n', ' File "C:\\Program Files\\ESOPPlone\\Zope\\lib\\python\\ZPublisher\\HTTPRequest.py", line 1194, in __getattr__\n raise AttributeError, key\n', 'AttributeError: expireCookie\n'
From: "Mauricio Souza Lima" <mauricio.lima@varig.com> To: "Ashley" <ashleylloyd@hotmail.com>,<zope@zope.org> Subject: RE: [Zope] Delete value from REQUEST Date: Thu, 22 Jan 2004 09:23:43 -0300
What zope didnt like? what was the error message?
-----Original Message----- From: zope-bounces@zope.org [mailto:zope-bounces@zope.org]On Behalf Of Ashley Sent: Thursday, January 22, 2004 8:03 AM To: zope@zope.org Subject: [Zope] Delete value from REQUEST
Sorry if this is a really stupid question, but either way I'd realy appreciate some help!
I have a problem deleting a value "theClient" from REQUEST. The value is set initially using: <dtml-call expr="RESPONSE.setCookie('theClient',whatever_value)">
I found some time ago this little external method posted by Daryl Tester:
=========================================================== def removeRequest(REQUEST, item): "Remove an item from a REQUEST.form" try: del REQUEST.form[item] except: pass return None ===========================================================
This obviously did not work straight away for this particular item, since it was in the cookies section of REQUEST, so I changed it to del REQUEST.cookies[item]. (Please bear with any ignorance I may have displayed here).
This initially appears to work fine. I call the external method from within a page, and then view REQUEST while still on the same page, and theClient has disappeared. However, if I subsequently go to any other page it is still there.
I have tried RESPONSE.expireCookie(item) in the external method, and Zope didn't seem to appreciate that!
What am I doing wrong?
TIA Ashley
_______________________________________________ Zope maillist - Zope@zope.org http://mail.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope-dev )
_________________________________________________________________ It's fast, it's easy and it's free. Get MSN Messenger today! http://www.msn.co.uk/messenger
Try to put it in a Python Script just as this: request = context.REQUEST response = request.RESPONSE response.expireCookie(item) reply if it works or not. []´s -- Mauricio Souza Lima Web Developer VARIG Brasil - GGTI mauricio.lima@varig.com
-----Original Message----- From: Ashley Lloyd [mailto:ashleylloyd@hotmail.com] Sent: Thursday, January 22, 2004 8:29 AM To: mauricio.lima@varig.com; zope@zope.org Subject: RE: [Zope] Delete value from REQUEST
Sorry, I had removed it and was hoping it wasn't going to be important, I got an AttributeError:
'Traceback (most recent call last):\n', ' File "C:\\Program Files\\ESOPPlone\\Data\\Extensions\\externalMethods.py", line 172, in removeRequest2\n del REQUEST.form[item]\n', ' File "C:\\Program Files\\ESOPPlone\\Zope\\lib\\python\\ZPublisher\\HTTPRequest.py", line 1194, in __getattr__\n raise AttributeError, key\n', 'AttributeError: expireCookie\n'
participants (2)
-
Ashley Lloyd -
Mauricio Souza Lima