Changeset 3443
- Timestamp:
- 09/02/07 12:57:04 (11 months ago)
- Files:
-
- branches/1.0/turbogears/visit/api.py (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
branches/1.0/turbogears/visit/api.py
r3366 r3443 4 4 from random import random 5 5 from datetime import timedelta, datetime 6 import time 6 7 7 8 import cherrypy … … 121 122 # By default, I don't specify the cookie domain. 122 123 self.cookie_domain = get("visit.cookie.domain", None) 124 self.cookie_max_age = int(get("visit.timeout", "20")) * 60 123 125 assert self.cookie_domain != "localhost", \ 124 126 "localhost is not a valid value for visit.cookie.domain. Try None instead." … … 193 195 cookies[self.cookie_name] = visit_key 194 196 cookies[self.cookie_name]['path'] = self.cookie_path 197 # We'd like to use the "max-age" param as 198 # http://www.faqs.org/rfcs/rfc2109.html indicates but IE doesn't 199 # save it to disk and the session is lost if people close 200 # the browser 201 # So we have to use the old "expires" ... sigh ... 202 #cookies[self.cookie_name]['max-age']= self.cookie_max_age 203 gmt_expiration_time = time.gmtime(time.time() + self.cookie_max_age) 204 cookies[self.cookie_name]['expires'] = time.strftime( 205 "%a, %d-%b-%Y %H:%M:%S GMT", gmt_expiration_time) 206 195 207 if self.cookie_secure: 196 208 cookies[self.cookie_name]['secure'] = True