gws.plugin.auth_session_manager.sqlite

SQLite session manager.

Stores sessions in the table sessions of an SQLite database. By default, the database file is sessions.<version>.sqlite in the GWS misc directory, where <version> is the GWS version without the patch number. The table is created on first use.

A row holds the session uid (a random 64-character string), the uids of the method and the user, the serialized user, the session data as JSON, and the creation and update times. cleanup deletes expired sessions; create runs it at most every 10 minutes. touch updates the update time at most once a minute, unless the session data has changed. A session whose user cannot be restored is deleted and returned with the guest user.

Example:

auth.session {
    type "sqlite"
    path "/data/sessions.sqlite"
    lifeTime "30m"
    maxLifeTime "8h"
}

Source code: gws.plugin.auth_session_manager.sqlite

Package Contents

class gws.plugin.auth_session_manager.sqlite.Config

Bases: gws.base.auth.session_manager.Config

Session storage in an SQLite database.

path: str | None

Path to the SQLite session database file.

class gws.plugin.auth_session_manager.sqlite.Object

Bases: gws.base.auth.session_manager.Object

SQLite session manager.

dbPath: str

Path to the SQLite database file.

table = 'sessions'
cleanup()
configure()
create(method, user, data=None)
delete(sess)
delete_all()
get(uid)
list_all()
save(sess)
touch(sess)