Package cherrypy :: Package lib :: Module sessions :: Class FileSession
[hide private]
[frames] | no frames]

Class FileSession

source code

object --+    
         |    
   Session --+
             |
            FileSession

Implementation of the File backend for sessions

storage_path: the folder where session data will be saved. Each session
    will be saved as pickle.dump(data, expiration_time) in its own file;
    the filename will be self.SESSION_PREFIX + self.id.

Nested Classes [hide private]

Inherited from Session: __metaclass__

Instance Methods [hide private]
 
__init__(self, id=None, **kwargs)
x.__init__(...) initializes x; see x.__class__.__doc__ for signature
source code
 
_get_file_path(self) source code
 
_exists(self) source code
 
_load(self, path=None) source code
 
_save(self, expiration_time) source code
 
_delete(self) source code
 
acquire_lock(self, path=None)
Acquire an exclusive lock on the currently-loaded session data.
source code
 
release_lock(self, path=None)
Release the lock on the currently-loaded session data.
source code
 
clean_up(self)
Clean up expired sessions.
source code
 
__len__(self)
Return the number of active sessions.
source code

Inherited from Session: __contains__, __delitem__, __getitem__, __setitem__, clear, delete, generate_id, get, has_key, items, keys, load, pop, regenerate, save, setdefault, update, values

Inherited from Session (private): _get_id, _set_id

Inherited from object: __delattr__, __getattribute__, __hash__, __new__, __reduce__, __reduce_ex__, __repr__, __setattr__, __str__

Class Methods [hide private]
 
setup(cls, **kwargs)
Set up the storage system for file-based sessions.
source code
Class Variables [hide private]
  SESSION_PREFIX = 'session-'
  LOCK_SUFFIX = '.lock'

Inherited from Session: clean_freq, clean_freq__doc, clean_thread, clean_thread__doc, id__doc, id_observers, id_observers__doc, loaded, loaded__doc, locked, locked__doc, timeout, timeout__doc

Inherited from Session (private): _id

Properties [hide private]

Inherited from Session: id

Inherited from object: __class__

Method Details [hide private]

__init__(self, id=None, **kwargs)
(Constructor)

source code 

x.__init__(...) initializes x; see x.__class__.__doc__ for signature

Overrides: object.__init__
(inherited documentation)

setup(cls, **kwargs)
Class Method

source code 

Set up the storage system for file-based sessions.

This should only be called once per process; this will be done automatically when using sessions.init (as the built-in Tool does).

clean_up(self)

source code 

Clean up expired sessions.

Overrides: Session.clean_up