Hi, Is it possible to override the way Zope escapes it's cookies? When a cookie is set by Zope (eg. when you consult the help or by setting it with REQUEST.RESPONSE.setCookie), the cookie-value is enclosed by escaped quotes (eg \"mycookievalue\"). I would like to use quote-less cookievalues because it confuses some log-analyzing programs. Anyone encountered this problem (and preferrably it's solution)? Grts, Ronny __________________________________________________ Do you Yahoo!? New DSL Internet Access from SBC & Yahoo! http://sbc.yahoo.com
John Doe wrote:
Hi,
Is it possible to override the way Zope escapes it's cookies? When a cookie is set by Zope (eg. when you consult the help or by setting it with REQUEST.RESPONSE.setCookie), the cookie-value is enclosed by escaped quotes (eg \"mycookievalue\").
I would like to use quote-less cookievalues because it confuses some log-analyzing programs.
Anyone encountered this problem (and preferrably it's solution)?
I'm quite sure you can't change that behaviour of setCookie(), because it's hard-coded in ZPublisher.HTTPResponse._cookie_list. But you should be able to use RESPONSE.appendHeader: def appendHeader(self, name, value, delimiter=","): '''\ Append a value to a cookie Sets an HTTP return header "name" with value "value", appending it following a comma if there was a previous value set for the header. ''' and append the right header to you response, something like RESPONSE.appendHeader('Set-Cookie:', 'cookie_name = cookie_value, <other headers>') For right syntax of the "Set_cookie"-header, there's a RFC, or look up in google. HTH, oliver
I know, but that doesn't solve the problem for the cookies which are set by the Zope-server itself like the 'help'-cookie, preferences-cookie (eg certain width for the screen), etc --- Oliver Bleutgen <myzope@gmx.net> wrote:
John Doe wrote:
Hi,
Is it possible to override the way Zope escapes it's cookies? When a cookie is set by Zope (eg. when you consult the help or by setting it with REQUEST.RESPONSE.setCookie), the cookie-value is enclosed by escaped quotes (eg \"mycookievalue\").
I would like to use quote-less cookievalues
because it
confuses some log-analyzing programs.
Anyone encountered this problem (and preferrably it's solution)?
I'm quite sure you can't change that behaviour of setCookie(), because it's hard-coded in ZPublisher.HTTPResponse._cookie_list. But you should be able to use RESPONSE.appendHeader:
def appendHeader(self, name, value, delimiter=","): '''\ Append a value to a cookie
Sets an HTTP return header "name" with value "value", appending it following a comma if there was a previous value set for the header. '''
and append the right header to you response, something like RESPONSE.appendHeader('Set-Cookie:', 'cookie_name = cookie_value, <other headers>')
For right syntax of the "Set_cookie"-header, there's a RFC, or look up in google.
HTH, oliver
__________________________________________________ Do you Yahoo!? New DSL Internet Access from SBC & Yahoo! http://sbc.yahoo.com
John Doe <gvd_76@yahoo.com> wrote:
Is it possible to override the way Zope escapes it's cookies? When a cookie is set by Zope (eg. when you consult the help or by setting it with REQUEST.RESPONSE.setCookie), the cookie-value is enclosed by escaped quotes (eg \"mycookievalue\").
I would like to use quote-less cookievalues because it confuses some log-analyzing programs.
Anyone encountered this problem (and preferrably it's solution)?
It's a Zope quirk that could be considered a bug. Please file a collector issue at http://collector.zope.org/Zope Thanks, Florent -- Florent Guillaume, Nuxeo (Paris, France) +33 1 40 33 79 87 http://nuxeo.com mailto:fg@nuxeo.com
It's a bug. I filed a collector issue on this a few weeks ago. http://collector.zope.org/Zope/569
-----Original Message----- From: zope-admin@zope.org [mailto:zope-admin@zope.org]On Behalf Of John Doe Sent: Monday, September 30, 2002 7:12 AM To: zope@zope.org Subject: [Zope] override cookie espacing?
Hi,
Is it possible to override the way Zope escapes it's cookies? When a cookie is set by Zope (eg. when you consult the help or by setting it with REQUEST.RESPONSE.setCookie), the cookie-value is enclosed by escaped quotes (eg \"mycookievalue\").
I would like to use quote-less cookievalues because it confuses some log-analyzing programs.
Anyone encountered this problem (and preferrably it's solution)?
Grts, Ronny
__________________________________________________ Do you Yahoo!? New DSL Internet Access from SBC & Yahoo! http://sbc.yahoo.com
_______________________________________________ Zope maillist - Zope@zope.org http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )
participants (4)
-
Charlie Reiman -
Florent Guillaume -
John Doe -
Oliver Bleutgen