Download Install Tutorial Docs FAQ Tools WikiLicense Team IRC Planet Involvement Shop Book

Changeset 1177

Show
Ignore:
Timestamp:
06/29/06 18:50:12
Author:
fumanchu
Message:

Fix for #512 (Cookie.expires should be optional).

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/cherrypy/_cptools.py

    r1172 r1177  
    182182             
    183183            s = cherrypy.request._session = _sessions.Session() 
     184            # Copy all conf entries onto Session object attributes 
    184185            for k, v in conf.iteritems(): 
    185186                setattr(s, str(k), v) 
  • trunk/cherrypy/lib/sessions.py

    r1174 r1177  
    130130        #   So we have to use the old "expires" ... sigh ... 
    131131        #cookie[cookie_name]['max-age'] = self.timeout * 60 
    132         gmt_expiration_time = time.gmtime(time.time() + (self.timeout * 60)) 
    133         cookie[self.cookie_name]['expires'] = http.HTTPDate(gmt_expiration_time) 
     132        if self.timeout: 
     133            gmt_expiration_time = time.gmtime(time.time() + (self.timeout * 60)) 
     134            cookie[self.cookie_name]['expires'] = http.HTTPDate(gmt_expiration_time) 
    134135        if self.cookie_domain is not None: 
    135136            cookie[self.cookie_name]['domain'] = self.cookie_domain 

Hosted by WebFaction

Log in as guest/cpguest to create tickets