Session Module¶
session related module
Session()
¶
Base class for objects covers data related to a server side session.
SessionContext
¶
SessionManager(storage)
¶
Bases: SessionContext
A SessionManager controls the lifecycle of sessions and is responsible to establish a session context local.
InMemoryStorage(max_size=1000, ttl=3600)
¶
Bases: Storage
InMemoryStorage is a simple in-memory storage for sessions. It uses a TTLCache to store sessions with a time-to-live.
create_session(*args, **kwargs)
¶
create a session given the arguments (usually a token, etc.) Args: args: rest args kwargs: keyword args
Returns:
Type | Description |
---|---|
Session
|
the new session |
set_factory(factory)
¶
set a factory function that will be used to create a concrete session Args: factory: the function