> Christoph Zwerschke a écrit :
>> I tried with
>> self.response().setCookie('mycookie', 'myvalue')
>> in one servlet - the cookie was there, and then
>> in another servlet - the cookie was gone.
> Did you try with an url rewrite rule?
> Maybe the one I have?
No, but if you set cookies manually, the path is always set to '/'
unless you specify otherwise. The automatic path determination applies
only to the session cookie. So rewrite plays no role here.
However, I can imagine one problem. In 0.9.4, cookie.delete() does not
set the path to '/' any more, but leaves it alone. This was changed
because the session cookie can have a different path from '/'. However,
for a manually set cookie, delCookie now deletes a cookie with path='',
while setCookie had set a cookie with path='/'. Maybe some browsers
think the cookies are different because of that. (Which browser were you
using? I tested with Firefox.) My solution was to add a parameter "path"
with the same default '/' as setCookie to delCookie to make sure the
cookies always have the same path.
You must check out the new version of HTTPResponse.py for testing:
By the way, you can also use Session() instead of manually fiddling
around with cookies. That's much easier.