Ticket #1375: tg.patch

File tg.patch, 1.0 kB (added by corvus, 1 year ago)

visit api.py patch

  • turbogears/visit/api.py

    old new  
    121121        # The path should probably default to whatever the root is masquerading 
    122122        # as in the event of a virtual path filter. 
    123123        self.cookie_path= get( "visit.cookie.path", "/" ) 
     124        # The secure bit should be set for HTTPS only sites 
     125        self.cookie_secure= get( "visit.cookie.secure", False ) 
    124126        # By default, I don't specify the cookie domain. 
    125127        self.cookie_domain= get( "visit.cookie.domain", None ) 
    126128        assert self.cookie_domain!="localhost", \ 
     
    193195        cookies= cherrypy.response.simple_cookie 
    194196        cookies[self.cookie_name]= visit_key 
    195197        cookies[self.cookie_name]['path']= self.cookie_path 
     198        if self.cookie_secure: 
     199            cookies[self.cookie_name]['secure']= True 
    196200        if self.cookie_domain: 
    197201            cookies[self.cookie_name]['domain']= self.cookie_domain 
    198202        log.debug( "Sending visit ID cookie: %s",