core.browser_session
Attributes
Classes
A session bound to a token (session_id cookie). Used to store data |
Module Contents
- class core.browser_session.Prefixed(prefix: str, cache: core.cache.RedisCacheRegion)[source]
- class core.browser_session.BrowserSession(cache: core.cache.RedisCacheRegion, token: str, on_dirty: OnDirtyCallback = lambda session, token: ...)[source]
A session bound to a token (session_id cookie). Used to store data about a client on the server.
Instances should be called
browser_session
to make sure we don’t confuse this with the orm sessions.Used by
onegov.core.request.CoreRequest
.Example:
browser_session = request.browser_session browser_session.name = 'Foo' assert client.session.name == 'Foo' del client.session.name
This class can act like an object, through attribute access, or like a dict, through square brackets. Whatever you prefer.