<<

NAME

MT::Session - temporary storage of arbitrary data.

SYNOPSIS

Provides for the storage of arbitrary temporary data. The name "session" is a hold-over from the days when commenter sessions were the only kind of temporary data that MT stored.

A piece of temporary data is identified uniquely by an ID, but it also has a "kind," a two-character identifier that separates different usages of the table. The id value must be distinct across all kinds.

Each kind is associated with a fixed timeout window; records older than that amount are deleted automatically. Currently-used kinds are as follows:

SI

Active commenter sessions are held in SI sessions.

KY

The public key of the remote comment authentication service is held in the single record of kind 'KY'.

AN

"Nonce" values (used for certain authentication systems) are stored with a kind of 'AN'.

US

Active user sessions are held in 'US' records.

NW

The cached contents of the newsbox (top right of MT's welcome screen) is held in the single record of kind 'NW'.

METHODS

$sess = MT::Session->get_unexpired_value($timeout[, $terms[, $args, ...]]);

Fetches the specified session record, if it is current (its start field falls within last $timeout seconds). Arguments following the $timeout argument are passed directly to MT::Object::load.

$sess->get($var)

Return the value of var.

is_dirty

Return the value of the session __dirty flag.

$sess->save()

Save the session data and unset the __dirty flag.

$sess->set($var, $val)

Set the var to val and set the session __dirty flag.

$sess->thaw_data()

Return the session data and unset the __dirty flag.

AUTHOR & COPYRIGHT

Please see "AUTHOR & COPYRIGHT" in MT.

<<