From: sophana <so...@zi...> - 2007-08-19 00:04:19
|
Hi I have the same application over 4 servers, 2 have webware 0.9.4 with fedora core 6, the others have webware 0.9.2 with centos4. With 0.9.2 delCookie works, but no more with 0.9.4 The created cookie is the same in both cases (the path is /) Is it related to the session cookie path modification? Anyone knows a workaround? Thanks |
From: Christoph Z. <ci...@on...> - 2007-08-30 09:21:47
|
sophana wrote: > I have the same application over 4 servers, 2 have webware 0.9.4 with > fedora core 6, the others have webware 0.9.2 with centos4. > With 0.9.2 delCookie works, but no more with 0.9.4 > The created cookie is the same in both cases (the path is /) > Is it related to the session cookie path modification? There was a problem with delCookie in 0.9.3 but that should have been fixed in 0.9.4 (r6559(. Can you explain more exactly what you're doing or provide a test case? -- Chris |
From: Sophana <so...@zi...> - 2007-08-30 09:58:38
|
Christoph Zwerschke a écrit : > sophana wrote: > >> I have the same application over 4 servers, 2 have webware 0.9.4 with >> fedora core 6, the others have webware 0.9.2 with centos4. >> With 0.9.2 delCookie works, but no more with 0.9.4 >> The created cookie is the same in both cases (the path is /) >> Is it related to the session cookie path modification? >> > > There was a problem with delCookie in 0.9.3 but that should have been > fixed in 0.9.4 (r6559(. Can you explain more exactly what you're doing > or provide a test case? > simple: self.response().delCookie('cookieName') works in 0.9.2 doesn't work in 0.9.4 (cookie creation works) I don't know how to debug that... |
From: Christoph Z. <ci...@on...> - 2007-08-30 12:22:22
|
Sophana wrote: > simple: > self.response().delCookie('cookieName') > works in 0.9.2 > doesn't work in 0.9.4 (cookie creation works) Hm, this is working for me in 0.9.4. I tried with self.response().setCookie('mycookie', 'myvalue') in one servlet - the cookie was there, and then self.response().delCookie('mycookie') in another servlet - the cookie was gone. -- Chris |
From: sophana <so...@zi...> - 2007-08-30 22:16:07
|
Christoph Zwerschke a écrit : > Sophana wrote: > >> simple: >> self.response().delCookie('cookieName') >> works in 0.9.2 >> doesn't work in 0.9.4 (cookie creation works) >> > > Hm, this is working for me in 0.9.4. > > I tried with > self.response().setCookie('mycookie', 'myvalue') > in one servlet - the cookie was there, and then > self.response().delCookie('mycookie') > in another servlet - the cookie was gone. > > -- Chris > Did you try with an url rewrite rule? Maybe the one I have? |
From: Christoph Z. <ci...@on...> - 2007-08-31 15:01:43
|
sophana wrote: > Christoph Zwerschke a écrit : >> I tried with >> self.response().setCookie('mycookie', 'myvalue') >> in one servlet - the cookie was there, and then >> self.response().delCookie('mycookie') >> 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: http://svn.w4py.org/Webware/trunk/WebKit/HTTPResponse.py By the way, you can also use Session() instead of manually fiddling around with cookies. That's much easier. -- Christoph |