MT::Session - temporary storage of arbitrary data.


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:


Active commenter sessions are held in SI sessions.


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


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


Active user sessions are held in 'US' records.


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


$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.


Return the value of var.


Return the value of the session __dirty flag.


Save the session data and unset the __dirty flag.

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

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


Return the session data and unset the __dirty flag.


Please see "AUTHOR & COPYRIGHT" in MT.