circuits.web.sessions module

Session Components

This module implements Session Components that can be used to store and access persistent information.

class circuits.web.sessions.MemoryStore

Bases: circuits.web.sessions.Store

data
delete(sid)

Delete the session data identified by sid

load(sid)

Load the session data identified by sid

save(sid, data)

Save the session data identified by sid

class circuits.web.sessions.Session(sid, data, store)

Bases: dict

expire()
sid
store
class circuits.web.sessions.Sessions(name='circuits', store=<class 'circuits.web.sessions.MemoryStore'>, channel='web')

Bases: circuits.core.components.Component

channel = 'web'
name
request(request, response)
store
class circuits.web.sessions.Store

Bases: object

delete(sid)

Delete the session data identified by sid

load(sid)

Load the session data identified by sid

save(sid)

Save the session data identified by sid

circuits.web.sessions.create_session(request)

Create a unique session id from the request

Returns a unique session using uuid4() and a sha1() hash of the users IP Address and User Agent in the form of sid/who.

circuits.web.sessions.verify_session(request, sid)

Verify a User’s Session

This verifies the User’s Session by verifying the SHA1 Hash of the User’s IP Address and User-Agent match the provided Session ID.

circuits.web.sessions.who(request, encoding='utf-8')

Create a SHA1 Hash of the User’s IP Address and User-Agent