[Zope] Delete value from REQUEST

Ashley Lloyd ashleylloyd at hotmail.com
Thu Jan 22 06:28:44 EST 2004


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 at varig.com>
>To: "Ashley" <ashleylloyd at hotmail.com>,<zope at 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 at zope.org [mailto:zope-bounces at zope.org]On Behalf Of
> > Ashley
> > Sent: Thursday, January 22, 2004 8:03 AM
> > To: zope at 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 at 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




More information about the Zope mailing list