web.web.session.DiskStore

Package web :: Package web :: Module session :: Class DiskStore |
[hide private]
[frames] | no frames]

# Class DiskStore

source code

    Store --+
            |
           DiskStore

Store for saving a session on disk.

    >>> import tempfile
    >>> root = tempfile.mkdtemp()
    >>> s = DiskStore(root)
    >>> s['a'] = 'foo'
    >>> s['a']
    'foo'
    >>> time.sleep(0.01)
    >>> s.cleanup(0.01)
    >>> s['a']
    Traceback (most recent call last):
        ...
    KeyError: 'a'

Instance Methods | [hide private]
__init__(self, root) | source code
_get_path(self, key) | source code
__contains__(self, key) | source code
__getitem__(self, key) | source code
__setitem__(self, key, value) | source code
__delitem__(self, key) | source code
cleanup(self, timeout) removes all the expired sessions | source code
Inherited from `Store`: `decode`, `encode`

Method Details | [hide private]

### __contains__(self, key) (In operator) | source code
Overrides: Store.__contains__

### __getitem__(self, key) (Indexing operator) | source code
Overrides: Store.__getitem__

### __setitem__(self, key, value) (Index assignment operator) | source code
Overrides: Store.__setitem__

### cleanup(self, timeout) | source code
removes all the expired sessions Overrides: Store.cleanup (inherited documentation)