mewlo.mpacks.core.session.msession module Database object for storing session data

class mewlo.mpacks.core.session.msession.MewloSession[source]

Bases: mewlo.mpacks.core.database.mdbmodel.MewloDbModel

Session object / database model.


Add a quick message to show (possibly anonymouse) visitor on their next page.


Create a new unique session hashkey.

dbtablename = 'session'
classmethod define_fields(dbmanager)[source]

This class-level function defines the database fields for this model – the columns, etc.


Return the list of session messages, consuming them from session by default.

get_sessionvar(keyname, defaultval)[source]

Lazy return the user OBJECT associated with this session.


Manually called init on manually created new instances.


Set values for a new session.


Set a random hashkey for the session. This is slightly awkward since we would really like to keep the session function generator in the MewloSessionManager class. But then we don’t know how to invoke that here since a session doesn’t get a reference to the helper (we could change that). ATTN: UNFINISHED.


Store session manager.

set_sessionvar(keyname, val)[source]

Set the user for a session. This may happen after a login, or after a guest user account is set up for a visitor. There is one important security concern we should be aware of: We may want to force a change of the session id any time the user identity changes from one user to another. That would prevent a client from tricking another client to use their session id and then login, essentially upgrading the previous session id user.


Get the user manager, from the session manager.


Update access time.

Table Of Contents

Previous topic

mewlo.mpacks.core.session package

Next topic

mewlo.mpacks.core.session.msessionmanager module

This Page