jacinle.web.session#

Classes

Class InMemorySessionManager

class InMemorySessionManager[source]#

Bases: KVBasedSessionManager

__init__(secret, timeout, cookie_prefix='jac_ses_', kv_prefix='jac_ses_')[source]#
Parameters:
  • secret (str)

  • timeout (int)

  • cookie_prefix (str)

  • kv_prefix (str)

__new__(**kwargs)#
get(request_handler)#
new(request_handler)#
set(request_handler, identifier, data)#
property secret#

Class KVBasedSessionManager

class KVBasedSessionManager[source]#

Bases: SessionManagerBase

__init__(secret, kvstore, timeout, cookie_prefix='jac_ses_', kv_prefix='jac_ses_')[source]#
Parameters:
__new__(**kwargs)#
get(request_handler)[source]#
new(request_handler)#
set(request_handler, identifier, data)[source]#
property secret#

Class MemcachedSessionManager

class MemcachedSessionManager[source]#

Bases: KVBasedSessionManager

__init__(secret, memcache_host, memcache_port, timeout, cookie_prefix='jac_ses_', kv_prefix='jac_ses_')[source]#
__new__(**kwargs)#
get(request_handler)#
new(request_handler)#
set(request_handler, identifier, data)#
property secret#

Class Session

class Session[source]#

Bases: dict

__init__(session_manager, request_handler)[source]#
save()[source]#
property identifier#

Class SessionIdentifier

class SessionIdentifier[source]#

Bases: SessionIdentifier

__add__(value, /)#

Return self+value.

__init__()#
__mul__(value, /)#

Return self*value.

static __new__(_cls, session_id, hmac_key)#

Create new instance of SessionIdentifier(session_id, hmac_key)

count(value, /)#

Return number of occurrences of value.

index(value, start=0, stop=9223372036854775807, /)#

Return first index of value.

Raises ValueError if the value is not present.

hmac_key: str#

Alias for field number 1

session_id: str#

Alias for field number 0

Class SessionManagerBase

class SessionManagerBase[source]#

Bases: object

__init__(secret)[source]#
__new__(**kwargs)#
get(request_handler)[source]#
new(request_handler)[source]#
set(request_handler, session_id, data)[source]#
property secret#