Skip to content

Session Module

session related module

Session()

Base class for objects covers data related to a server side session.

SessionManager()

A SessionManager controls the lifecycle of sessions and is responsible to establish a session thread local.

create_session(*args, **kwargs)

create a session given the argument s(usually a token, etc.) Args: args: rest args kwargs: keyword args

Returns:

Type Description
Session

the new session

current(type) classmethod

return the current session associated with the thread Args: type: the session type

Returns:

Type Description
T

the current session

delete_session() classmethod

delete the current session

set_session(session) classmethod

set the current session in the thread context Args: session: the session

set_session_factory(callable)

set a factory function that will be used to create a concrete session Args: callable: the function