smisk.core.FileSessionStore — File-based session store

class smisk.core.FileSessionStore(smisk.core.SessionStore)

Basic session store which uses files

See:SessionStore

Instance attributes

smisk.core.FileSessionStore.file_prefix

A string to prepend to each file stored in dir.

Defaults to tempfile.tempdir + "smisk-sess." – for example: /tmp/smisk-sess.

Type:string
smisk.core.FileSessionStore.gc_probability

New in version 1.1.

A value between 0 and 1 which defines the probability that sessions are garbage collected.

Garbage collection is only triggered when trying to read a session object, so this only effects requests which involves reading sessions.

Defaults to 0.1 (10% probability)

Type:float

Instance methods

smisk.core.FileSessionStore.read(session_id) → data
Parameters:
  • session_id (string) – Session ID
Raises:

InvalidSessionError if there is no actual session associated with session_id.

Return type:

object

smisk.core.FileSessionStore.write(session_id, data)
Parameters:
  • session_id (string) – Session ID
  • data (object) – Data to be associated with session_id
smisk.core.FileSessionStore.refresh(session_id)
TODO
smisk.core.FileSessionStore.destroy(session_id)
TODO
smisk.core.FileSessionStore.path(session_id) → string
Path to file for session_id.