repoze.session
is sessioning system for Python web applications.
repoze.session
automatically expires sessions which have been inactive for some timeout.
Here is an example of using the sessioning machinery in one of your applications:
code/sample.py
The value you send in to the session manager's get
method should be a value you've managed to assign to a particular user, perhaps via a cookie. See repoze.browserid
for a library that manages browser identifiers. These identifiers can be used as session manager keys.
repoze.session
allows you to register session-end and session-begin subscribers in order to react to the start and end of a session.
code/subscribers.py
Values inserted into a repoze.session
session store should not subclass ZODB Persistent
class. If they do, there is a chance that irresolveable cross-database references will put into the session manager's (separate) database.
When the ConnectionManager
's commit
method is called, it will commit a transaction for all databases participating in Zope transaction management. Don't use this method if you already have transaction management enabled in another way.