[Zope3-dev] quoting cookies

Steve Alexander steve@cat-box.net
Thu, 20 Feb 2003 17:45:16 +0200


Shane Hathaway wrote:
> Tres Seaver wrote:
> 
>>    class IHTTPCookieQuoter(Interface):
>>       def quoteCookie(mapping):
>>           """ mapping->string.
>>
>>           o Applies appropriate quoting.
>>           """
>>
>> Then, in ZCML:
>>
>>    <utility component=".utilities.cookie_quoter"
>>          provides=".IHTTPCookieConverter"
>>          />
>>
>> People who want to change the policy then do it via configuration,
>> rather than code.
> 
> 
> Is there any reason people would want to change the policy?

If you want to interoperate with another system that uses its own 
quoting policy, under the same host name.

However, I think in this case, you should use the setCookie(raw=True) 
API, and use your own wrapper function in code.

If you're interoperating like this, then the nature of your cookies 
already depends on that other system. So, there's no benefit in 
extracting the quoting policy into a general adapter.

I don't actually have the requirement to interoperate in this way.

--
Steve Alexander