Kernel::System::AuthSession - global session interface
All session functions.
Don't use the constructor directly, use the ObjectManager instead:
my $SessionObject = $Kernel::OM->Get('Kernel::System::AuthSession');
checks a session, returns true (session ok) or false (session invalid)
my $Ok = $SessionObject->CheckSessionID( SessionID => '1234567890123456', );
Get the agent session limit prior warning message, if the limit is reached.
my $PriorMessage = $SessionObject->CheckAgentSessionLimitPriorWarning(); returns the prior warning message (AgentSessionLimitPriorWarning reached) or false (AgentSessionLimitPriorWarning not reached)
returns an error in the session handling
my $Message = $SessionObject->SessionIDErrorMessage();
get session data in a hash
my %Data = $SessionObject->GetSessionIDData( SessionID => '1234567890123456', );
Returns:
%Data = ( UserSessionStart => '1293801801', UserRemoteAddr => '127.0.0.1', UserRemoteUserAgent => 'Some User Agent x.x', UserLastname => 'SomeLastName', UserFirstname => 'SomeFirstname', # and all other preferences values );
create a new session with given data
my $SessionID = $SessionObject->CreateSessionID( UserLogin => 'root', UserEmail => 'root@example.com', );
removes a session and returns true (session deleted), false (if session can't get deleted)
$SessionObject->RemoveSessionID(SessionID => '1234567890123456');
Removes a session from a user.
$SessionObject->RemoveSessionByUser( UserLogin => 'some_user_login' );
Returns true (session deleted) or false (if session can't get deleted).
update session info by key and value, returns true (if ok) and false (if can't update)
$SessionObject->UpdateSessionID( SessionID => '1234567890123456', Key => 'LastScreenOverview', Value => 'SomeInfo', );
returns a array of an array of session ids that have expired, and one array of session ids that have been idle for too long.
my @Sessions = $SessionObject->GetExpiredSessionIDs(); my @ExpiredSession = @{$Session[0]}; my @ExpiredIdle = @{$Session[1]};
returns an array with all session ids
my @Sessions = $SessionObject->GetAllSessionIDs();
Get the current active sessions for the given UserType.
my %Result = $SessionObject->GetActiveSessions( UserType => '(User|Customer)', );
returns
%Result = ( Total => 8, PerUser => { UserID1 => 2, UserID2 => 1, }, );
clean-up of sessions in your system
$SessionObject->CleanUp();
This software is part of the OTRS project (https://otrs.org/).
This software comes with ABSOLUTELY NO WARRANTY. For details, see the enclosed file COPYING for license information (GPL). If you did not receive this file, see https://www.gnu.org/licenses/gpl-3.0.txt.