Hello, As i know, there's always only one cookie for one url. And 'test1' is the key with it's value 'value1'. like: ----------------------- cookie-souce test_data1 "t1" xf130lg/ 1024 2778255872 30795568 2735860320 29657955 * test_data2 "t2" xf130lg/ 1024 2778255872 30795568 2735860320 29657955 * test_data3 "t3" xf130lg/ 1024 2778255872 30795568 2735860320 29657955 * ----------------------- the 'problem'-server only gets ----------------------- cookie-souce test_data3 "t3" xf130lg/ 1024 2778255872 30795568 2735860320 29657955 * ----------------------- with the same script... Thanks for help regards Jens Walte -------- Original Message -------- Subject: Re: [Zope] Problems with setCookie (26-Aug-2004 18:12) From: vahur@tpu.ee To: jw@obelix.bb.kk.net
jens.walte@kk.net wrote:
Hello,
the following source should set 3 values to a cookie:
<dtml-call "RESPONSE.setCookie('test1', 'value1', path='/', expires='Wed, 20 Feb 2020 20:00:00 GMT')"> <dtml-call "RESPONSE.setCookie('test2', 'value2', path='/', expires='Wed, 20 Feb 2020 20:00:00 GMT')"> <dtml-call "RESPONSE.setCookie('test3', 'value3', path='/', expires='Wed, 20 Feb 2020 20:00:00 GMT')">
but after this there's only one value in the cookie! (normaly 'value3'?)
Does anybody knows the reason?
Just a wild guess but I think you're creating 3 different cookies - test1, test2 and test3 as cookie names
Vahur
_______________________________________________ Zope maillist - Zope@zope.org http://mail.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope-dev )
To: vahur@tpu.ee Cc: zope@zope.org
Ok, I was wrong. Did some digging and setCookie function docstring says: Set an HTTP cookie on the browser The response will include an HTTP header that sets a cookie on cookie-enabled browsers with a key "name" and value "value". This overwrites any previously set value for the cookie in the Response object. Maybe use appendCookie() then? Vahur
Hello,
As i know, there's always only one cookie for one url. And 'test1' is the key with it's value 'value1'.
like: ----------------------- cookie-souce test_data1 "t1" xf130lg/ 1024 2778255872 30795568 2735860320 29657955 * test_data2 "t2" xf130lg/ 1024 2778255872 30795568 2735860320 29657955 * test_data3 "t3" xf130lg/ 1024 2778255872 30795568 2735860320 29657955 * -----------------------
the 'problem'-server only gets ----------------------- cookie-souce test_data3 "t3" xf130lg/ 1024 2778255872 30795568 2735860320 29657955 * ----------------------- with the same script...
Thanks for help regards Jens Walte
-------- Original Message -------- Subject: Re: [Zope] Problems with setCookie (26-Aug-2004 18:12) From: vahur@tpu.ee To: jw@obelix.bb.kk.net
jens.walte@kk.net wrote:
Hello,
the following source should set 3 values to a cookie:
<dtml-call "RESPONSE.setCookie('test1', 'value1', path='/', expires='Wed,
20 Feb 2020 20:00:00 GMT')">
<dtml-call "RESPONSE.setCookie('test2', 'value2', path='/', expires='Wed,
20 Feb 2020 20:00:00 GMT')">
<dtml-call "RESPONSE.setCookie('test3', 'value3', path='/', expires='Wed,
20 Feb 2020 20:00:00 GMT')">
but after this there's only one value in the cookie! (normaly 'value3'?)
Does anybody knows the reason?
----- Original Message ----- From: <jens.walte@kk.net>
As i know, there's always only one cookie for one url. And 'test1' is the key with it's value 'value1'.
like: ----------------------- cookie-souce test_data1 "t1" xf130lg/ 1024 2778255872 30795568 2735860320 29657955 * test_data2 "t2" xf130lg/ 1024 2778255872 30795568 2735860320 29657955 * test_data3 "t3" xf130lg/ 1024 2778255872 30795568 2735860320 29657955 * -----------------------
the 'problem'-server only gets ----------------------- cookie-souce test_data3 "t3" xf130lg/ 1024 2778255872 30795568 2735860320 29657955 * ----------------------- with the same script...
We use routines which set multiple cookies without any problems... Each call to RESPONSE.setCookie('cookiename', 'cookievalue') will create a new cookie if 'cookiename' is different (ie. you can have multiple cookies set by the same routine). Using the same 'cookiename' will overwrite the previous contents of the cookie. One thing to check is that RESPONSE.setCookie sets a cookie in the user's browser, but that cookie is NOT seen in REQUEST until the user next accesses your zope system. (ie. the zope mechanism does not set the cookie until the current routine completes successfully. Therefore if you set the cookie and then check for the cookie value right away (ie. in the same routine that sets the cookie) you won't see the cookie value (one way to get around this is to set the cookie and then set a variable in REQUEST with the same name/value as the cookie you just set). A quick way to check your cookies is to have two routines: the first sets your 3 cookies and does nothing else; the second just displays the contents of REQUEST. Manually invoke the first routine and when it finishes, manually invoke the second routine. This should eliminate any other possible causes of problems and let you see if the cookies are being set properly. HTH Jonathan
participants (3)
-
jens.walte@kk.net -
Jonathan Hobbs -
Vahur Rebas