RT 6.0.0 Documentation
RT::Interface::Web::Session
NAME
RT::Interface::Web::Session - RT web session class
SYNOPSIS
DESCRIPTION
RT session class and utilities.
CLASS METHODS can be used without creating object instances, it's mainly utilities to clean unused session records.
Object is tied hash and can be used to access session data.
METHODS
CLASS METHODS
Class
Returns name of the class that is used as sessions storage.
Backends
Returns hash reference with names of the databases as keys and sessions class names as values.
Attributes
Returns hash reference with attributes that are used to create new session objects.
Ids
Returns array ref with list of the session IDs.
ClearOld
Takes seconds and deletes all sessions that are older.
ClearOrphanLockFiles
Takes a directory in which to look for Apache::Session::Lock::File locks which no longer have a corresponding session file. If not provided, the directory is taken from the session configuration data.
ClearByUser
Checks all sessions and if user has more then one session then leave only the latest one.
Load
Load a session or create a new one.
Accepts: Ref, Id
Ref is a reference to a hash which will be loaded with session data.
Id is the id of an existing session. If set to undef or omitted, an empty new session will be created with a session id set with the key '_session_id'.
Set
Set a value in the session.
Accepts: Ref, Key, SubKey, SubSubKey, Value
Ref is a reference to a hash for an existing session. It is expected to have a key '_session_id' with the id of the current session. The referenced hash will be also be updated with the new value.
Key and the SubKey parameters indicate where in the hash to set the value. The multiple subkey arguments handle multiple hash levels from the previous direct hash implementation.
Value is the value to set in the indicated key.
If _session_id is not set, it simply updates Ref.
Delete
Delete a key from the session.
Accepts: Ref, Key, SubKey, SubSubKey
Ref is a reference to a hash for an existing session. It is expected to have a key '_session_id' with the id of the current session. The referenced hash will be also be updated with the new value.
Key and the SubKey parameters indicate where in the hash to delete the key. The multiple subkey arguments handle multiple hash levels from the previous direct hash implementation.
If _session_id is not set, it simply deletes from Ref.
← Back to index