[Zope] override cookie espacing?

John Doe gvd_76@yahoo.com
Mon, 30 Sep 2002 08:42:16 -0700 (PDT)


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