RestOC.Sesh module

Sesh Module

Handles internal sessions shared across microservices

RestOC.Sesh.create(id=None, expires=None)

Create

Returns a brand new session using the ID given, if no ID is passed, one is generated

Parameters
  • id (str) – The ID to use for the session

  • expires (uint) – A specific expiry in seconds to override the global one for this session

Returns

Session

RestOC.Sesh.init(conf, expire=86400)

Init

Initialises the module

Parameters
  • conf (dict) – The necessary Redis config

  • expire (uint) – Length in seconds for the session to remain active

Returns

None

RestOC.Sesh.load(id)

Load

Loads an existing session from the cache

Parameters

id (str) – The unique id of an existing session

Returns

Session