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

Ticket #512: cp-session_cookie.diff

  • cherrypy/filters/sessionfilter.py

    old new  
    77Variables used to store config options: 
    88    - sess.session_timeout: timeout delay for the session 
    99    - sess.session_locking: mechanism used to lock the session ('implicit' or 'explicit') 
     10    - sess.session_cookie: expire the cookie at the end of the browser session. 
    1011 
    1112Variables used to store temporary variables: 
    1213    - sess.session_storage (instance of the class implementing the backend) 
     
    8081         
    8182        # Read config options 
    8283        sess.session_timeout = conf('session_filter.timeout', 60) 
     84        sess.session_cookie = conf('session_filter.session_cookie', False) 
    8385        sess.session_locking = conf('session_filter.locking', 'explicit') 
    8486        sess.on_create_session = conf('session_filter.on_create_session', 
    8587                lambda data: None) 
     
    160162        #   the browser 
    161163        #   So we have to use the old "expires" ... sigh ... 
    162164        #cookie[cookie_name]['max-age'] = sess.session_timeout * 60 
    163         if sess.session_timeout
     165        if not sess.session_cookie
    164166            gmt_expiration_time = time.gmtime(time.time() + 
    165167                                              (sess.session_timeout * 60)) 
    166168            cookie[cookie_name]['expires'] = httptools.HTTPDate(gmt_expiration_time) 

Hosted by WebFaction

Log in as guest/cpguest to create tickets