The pse.plugins.session module can be used to store information between requests on a per user session basis. This module can be used to keep persistent data available for a specific user using cookies, even after the user has closed the browser and begun a new browsing session.
As with the pse.plugins.application module, session data can be stored in a global namespace or a namespace of your choosing to prevent accidental name collision in different parts of the application or between different applications. Namespace identifiers can be any hashable type for the purpose of dictionary keys. The only restriction is that namespaces cannot begin with the underscore character ("_").
The following values are configurable in the plugins.session section of the pse.conf file:
CollectionProbability1
CookieExpires360
DSNdbname=pse
File for
other session types' parameters.
FileFile is actually a
directory that holds the database and a Berkeley Database environment
subsystem for locking support. Default: /tmp/pse_session
DSN and Table for psycopg parameters.
Tablepse_session
File for
other session types' parameters.
Timeout360
Typedbm, sqlite or psycopg.
Default: dbm
New in version 3.0.
Data can be stored either in a BSD-style DBM hash file, an SQLite database or a PostgreSQL database. The BSD-style DBM session type requires the bsddb module, which builds by default with Python. The SQLite session type requires at least version 3 of the SQLite libraries and version 2 of Python module (pysqlite2). The psycopg (PostgreSQL) type requires the psycopg module, available from http://initd.org/software/initd/psycopg. Whichever module is used, all have the same interface as follows:
| [namespace]) |
If namespace is omitted, then the global session namespace will be returned.
| namespace) |