How to store a cookie in Zope? With RESPONSE.setCookie(name, value) I manage only to set a per-session cookie, which is not stored on a client computer. Zope reference gives such a header for this method: setCookie(name, value, **kw), but the **kw argument is not described. What it is? Artur
Hi Artur, --On Mittwoch, 8. August 2001 13:06 +0200 Artur Mozdzynski <artur@abfab.nl> wrote:
How to store a cookie in Zope? With RESPONSE.setCookie(name, value) I manage only to set a per-session cookie, which is not stored on a client computer.
Zope reference gives such a header for this method: setCookie(name, value, **kw), but the **kw argument is not described. What it is?
setCookie is a convenience function to construct the response header. As this rfc header can have some additional attributes, they can be given to the setCookie() method too. Useful options are: - expires this should be set to a date/time in the Future, where the cookie is to be expired (hence the name ;) The format is Wdy, DD-Mon-YYYY HH:MM:SS GMT, so you might want to use DateTime().strftime() here. - path At least if you set "expires" you should send a path (minimum /) from which the cookie should work. Otherwise it gets not stored for old Netscape versions and a few proxies (Novell Bordermanager[tm] is known to behave like this) - domain The domain for which the cookie has to be send for each request. This defaults to the exact hostname of the server. - secure you can specify this with secure='' to get the browser sending it only over ssl. HTH Tino Wildenhain
Arthur, if you dont specify the expiry date, the cookie is destroyed when the browser is closed: you need to specify an expiry date, e.g. <dtml-call "RESPONSE.setCookie('favorite_language', 'Python', expires='Wed, 19 Feb 2020 14:28:00 GMT')"> have a look at: http://www.zope.org/Members/BwanaZulia/cookies cheers, Garry On 8 Aug 2001, at 13:06, Artur Mozdzynski wrote: From: "Artur Mozdzynski" <artur@abfab.nl> To: <zope@zope.org> Subject: [Zope] Cookie Date sent: Wed, 8 Aug 2001 13:06:22 +0200
How to store a cookie in Zope? With RESPONSE.setCookie(name, value) I manage only to set a per-session cookie, which is not stored on a client computer.
Zope reference gives such a header for this method: setCookie(name, value, **kw), but the **kw argument is not described. What it is?
Artur
_______________________________________________ Zope maillist - Zope@zope.org http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )
+-------------------------------------------+ Garry Steedman mailto:gs@styrax.com Styrax Associates http://www.styrax.com/ "The Good Man has no shape." +-------------------------------------------+
participants (3)
-
Artur Mozdzynski -
Garry Steedman -
Tino Wildenhain