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

Changeset 1673

Show
Ignore:
Timestamp:
06/17/07 18:55:09
Author:
fumanchu
Message:

Fix for #680 (sessions save() and close() assume init() was called).

Files:

Legend:

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

    r1652 r1673  
    379379def save(): 
    380380    """Save any changed session data.""" 
     381    if not hasattr(cherrypy, "session"): 
     382        return 
     383     
    381384    # Guard against running twice 
    382385    if hasattr(cherrypy.request, "_sessionsaved"): 
     
    398401def close(): 
    399402    """Close the session object for this request.""" 
    400     sess = cherrypy.session 
    401     if sess.locked: 
     403    sess = getattr(cherrypy, "session", None) 
     404    if sess and sess.locked: 
    402405        # If the session is still locked we release the lock 
    403406        sess.release_lock() 
     
    471474        cookie[name]['secure'] = 1 
    472475 
     476 
    473477def expire(): 
    474478    """Expire the current session cookie.""" 

Hosted by WebFaction

Log in as guest/cpguest to create tickets