You are not logged in Log in Join
You are here: Home » Members » jmunoz » Use cookies with Zope and rfc 2109 » howto_view

Log in
Name

Password

 

Use cookies with Zope and rfc 2109

 

Created by jmunoz . Last modified 2003-10-13 11:43:03.

Use cookies with Zope and rfc 2109

Following the rfc 2109 (http://www.ietf.org/rfc/rfc2109.txt), and looking at zope sources (_cookie_list function at lib/python/ZPublisher/HTTPResponse.py), it seems that there is a better appropiated way to set a cookie expiration date with zope than setting the "expires" keyword argument of the setCookie function:

RESPONSE.setCookie(cookie_name, cookie_value, max_age=3600x24x30 )

Where max_age means (see rfc):

Max-Age=delta-seconds Optional. The Max-Age attribute defines the lifetime of the cookie, in seconds. The delta-seconds value is a decimal non- negative integer. After delta-seconds seconds elapse, the client should discard the cookie. A value of zero means the cookie should be discarded immediately.

Comment

Discussion icon 1066071393

Posted by: jmunoz at 2003-10-13

http://www.ietf.org/rfc/rfc2965.txt

Comment

Discussion icon 1066080202

Posted by: jmunoz at 2003-10-13

After testing it many times, it was impossible to do it work with IE 6... So using "expires" insteat of "max_age" is better, at less it works with Explorer.