diff -ru otrs.orig/Kernel/System/AuthSession/DB.pm otrs/Kernel/System/AuthSession/DB.pm --- otrs.orig/Kernel/System/AuthSession/DB.pm 2004-02-13 08:50:36.000000000 +0800 +++ otrs/Kernel/System/AuthSession/DB.pm 2004-09-01 11:56:39.000000000 +0800 @@ -84,7 +84,7 @@ } # check session time my $MaxSessionTime = $Self->{ConfigObject}->Get('SessionMaxTime'); - if ( (time() - $MaxSessionTime) >= $Data{UserSessionStart} ) { + if ( (time() - $MaxSessionTime) >= $Data{UserSessionLastTime} ) { $Kernel::System::AuthSession::CheckSessionID = 'Session has timed out. Please log in again.'; $Self->{LogObject}->Log( Priority => 'notice', @@ -97,6 +97,8 @@ } return; } + # update session time + $Self->UpdateSessionID(SessionID => $SessionID, Key => 'UserSessionLastTime', Value => time()); return 1; } # -- @@ -167,6 +169,7 @@ } } $DataToStore .= "UserSessionStart:" . encode_base64(time(), '') .":;"; + $DataToStore .= "UserSessionLastTime:" . encode_base64(time(), '') .":;"; $DataToStore .= "UserRemoteAddr:" . encode_base64($RemoteAddr, '') .":;"; $DataToStore .= "UserRemoteUserAgent:". encode_base64($RemoteUserAgent, '') .":;"; # store SessionID + data @@ -212,6 +215,8 @@ } # update the value $SessionData{$Key} = $Value; + # update the last time + $SessionData{"UserSessionLastTime"} = time(); # set new data sting my $NewDataToStore = ''; foreach (keys %SessionData) { diff -ru otrs.orig/Kernel/System/AuthSession/FS.pm otrs/Kernel/System/AuthSession/FS.pm --- otrs.orig/Kernel/System/AuthSession/FS.pm 2003-10-30 04:22:08.000000000 +0800 +++ otrs/Kernel/System/AuthSession/FS.pm 2004-09-01 11:57:02.000000000 +0800 @@ -77,7 +77,7 @@ } # check session time my $MaxSessionTime = $Self->{ConfigObject}->Get('SessionMaxTime'); - if ( (time() - $MaxSessionTime) >= $Data{UserSessionStart} ) { + if ( (time() - $MaxSessionTime) >= $Data{UserSessionLastTime} ) { $Kernel::System::AuthSession::CheckSessionID = 'Session has timed out. Please log in again.'; $Self->{LogObject}->Log( Priority => 'notice', @@ -90,6 +90,8 @@ } return; } + # update session time + $Self->UpdateSessionID(SessionID => $SessionID, Key => 'UserSessionLastTime', Value => time()); return 1; } # -- @@ -149,6 +151,7 @@ } } $DataToStore .= "UserSessionStart:". encode_base64(time(), '') ."\n"; + $DataToStore .= "UserSessionLastTime:". encode_base64(time(), '') ."\n"; $DataToStore .= "UserRemoteAddr:". encode_base64($RemoteAddr, '') ."\n"; $DataToStore .= "UserRemoteUserAgent:". encode_base64($RemoteUserAgent, '') ."\n"; # store SessionID + data @@ -192,6 +195,8 @@ my %SessionData = $Self->GetSessionIDData(SessionID => $SessionID); # update the value $SessionData{$Key} = $Value; + # update time + $SessionData{"UserSessionLastTime"} = time(); # set new data sting my $NewDataToStore = ''; foreach (keys %SessionData) { diff -ru otrs.orig/Kernel/System/AuthSession/IPC.pm otrs/Kernel/System/AuthSession/IPC.pm --- otrs.orig/Kernel/System/AuthSession/IPC.pm 2003-10-30 04:21:35.000000000 +0800 +++ otrs/Kernel/System/AuthSession/IPC.pm 2004-09-01 11:56:51.000000000 +0800 @@ -161,7 +161,7 @@ } # check session time my $MaxSessionTime = $Self->{ConfigObject}->Get('SessionMaxTime'); - if ( (time() - $MaxSessionTime) >= $Data{UserSessionStart} ) { + if ( (time() - $MaxSessionTime) >= $Data{UserSessionLastTime} ) { $Kernel::System::AuthSession::CheckSessionID = 'Session has timed out. Please log in again.'; $Self->{LogObject}->Log( Priority => 'notice', @@ -174,6 +174,8 @@ } return; } + # update session time + $Self->UpdateSessionID(SessionID => $SessionID, Key => 'UserSessionLastTime', Value => time()); return 1; } # -- @@ -239,6 +241,7 @@ } } $DataToStore .= "UserSessionStart:". encode_base64(time(), '') .";"; + $DataToStore .= "UserSessionLastTime:". encode_base64(time(), '') .";"; $DataToStore .= "UserRemoteAddr:". encode_base64($RemoteAddr, '') .";"; $DataToStore .= "UserRemoteUserAgent:". encode_base64($RemoteUserAgent, '') .";\n"; # read old session data (the rest) @@ -299,6 +302,8 @@ else { delete $SessionData{$Key}; } + # update time + $SessionData{"UserSessionLastTime"} = time(); # set new data sting my $NewDataToStore = "SessionID:". encode_base64($SessionID, '').";"; foreach (keys %SessionData) { diff -ru otrs.orig/bin/DeleteSessionIDs.pl otrs/bin/DeleteSessionIDs.pl --- otrs.orig/bin/DeleteSessionIDs.pl 2003-02-08 23:05:11.000000000 +0800 +++ otrs/bin/DeleteSessionIDs.pl 2004-09-01 11:57:24.000000000 +0800 @@ -85,7 +85,7 @@ foreach my $SessionID (@List) { my %SessionData = $CommonObject{SessionObject}->GetSessionIDData(SessionID => $SessionID); my $MaxSessionTime = $CommonObject{ConfigObject}->Get('SessionMaxTime'); - my $ValidTime = ($SessionData{UserSessionStart} + $MaxSessionTime) - time(); + my $ValidTime = ($SessionData{UserSessionLastTime} + $MaxSessionTime) - time(); if ($ValidTime >= 0) { print " SessionID $SessionID valid (till ". int(($ValidTime/60)) ." minutes).\n"; }