mewlo.mpacks.core.session.msession module

msession.py 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_sessionmessage(messagedict)[source]

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

clear_sessionvar(keyname)[source]
create_unique_sessionhashkey()[source]

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.

get_sessionmessages(flag_consume=True)[source]

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

get_sessionvar(keyname, defaultval)[source]
get_user()[source]

Lazy return the user OBJECT associated with this session.

init()[source]

Manually called init on manually created new instances.

init_values(ip)[source]

Set values for a new session.

set_randomhashkey()[source]

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.

set_sessionmanager(sessionmanager)[source]

Store session manager.

set_sessionvar(keyname, val)[source]
set_user(userobject)[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.

sitecomp_usermanager()[source]

Get the user manager, from the session manager.

update_access()[source]

Update access time.

Table Of Contents

Previous topic

mewlo.mpacks.core.session package

Next topic

mewlo.mpacks.core.session.msessionmanager module

This Page