parameters: (self)
docstring: Save session data.
docstring_summary: Save session data.
docstring_tokens: Save session data .
function: def save(self):
          """Save session data."""
          try:
              # If session data has never been loaded then it's never been
              #   accessed: no need to save it
              if self.loaded:
                  t = datetime.timedelta(seconds=self.timeout * 60)
                  expiration_time = self.now() + t
                  if self.debug:
                      cherrypy.log('Saving session %r with expiry %s' %
                                   (self.id, expiration_time),
                                   'TOOLS.SESSIONS')
                  self._save(expiration_time)
              else:
                  if self.debug:
                      cherrypy.log(
                          'Skipping save of session %r (no session loaded).' %
                          self.id, 'TOOLS.SESSIONS')
          finally:
              if self.locked:
                  # Always release the lock if the user didn't release it
                  self.release_lock()
                  if self.debug:
                      cherrypy.log('Lock released after save.', 'TOOLS.SESSIONS')
function_tokens: def save ( self ) : try : # If session data has never been loaded then it's never been #   accessed: no need to save it if self . loaded : t = datetime . timedelta ( seconds = self . timeout * 60 ) expiration_time = self . now ( ) + t if self . debug : cherrypy . log ( 'Saving session %r with expiry %s' % ( self . id , expiration_time ) , 'TOOLS.SESSIONS' ) self . _save ( expiration_time ) else : if self . debug : cherrypy . log ( 'Skipping save of session %r (no session loaded).' % self . id , 'TOOLS.SESSIONS' ) finally : if self . locked : # Always release the lock if the user didn't release it self . release_lock ( ) if self . debug : cherrypy . log ( 'Lock released after save.' , 'TOOLS.SESSIONS' )