Package aquarium :: Package database :: Package mysql :: Module Session :: Class Session
[show private | hide private]
[frames | no frames]

Class Session

AquariumClass --+
                |
               Session


This is a MySQL backend for aquarium.session.DatabaseSessionContainer.

To use this module, you'll need to add this to your schema:

CREATE TABLE Session
(
        sid CHAR(20) NOT NULL,
        last_modified TIMESTAMP NOT NULL,
        pickle LONGBLOB,
        PRIMARY KEY(sid)
);

To store pickles that are really large, you'll also need to update your my.cnf:

[mysqld] ... set-variable = max_allowed_packet=16M

The following class level constants are defined:

TABLE_NAME
This is the name of the table to store sessions in.

Method Summary
  cleanup(self)
Delete all of the expired sessions.
  exists(self, sid)
Does a session with the given sid exist?
  load(self, sid)
Load a session.
  save(self, session, pickle)
Persist a session.
    Inherited from AquariumClass
  __init__(self, ctx)
Set a reference to ctx.

Class Variable Summary
str TABLE_NAME = 'Session'

Method Details

cleanup(self)

Delete all of the expired sessions.

exists(self, sid)

Does a session with the given sid exist?

This implies that it is not expired.

load(self, sid)

Load a session.

Return it in its pickled form.

save(self, session, pickle)

Persist a session.


Class Variable Details

TABLE_NAME

Type:
str
Value:
'Session'                                                              

Generated by Epydoc 2.1 on Mon Jan 1 16:34:19 2007 http://epydoc.sf.net