From 126d36e4aeed5d4fa3291a5202f084d6a8e6fd03 Mon Sep 17 00:00:00 2001 From: JT Smith Date: Thu, 27 Feb 2003 02:38:33 +0000 Subject: [PATCH] Fixed a bug where session info was created unncessarily by the scheduler --- lib/WebGUI/Operation/Statistics.pm | 4 ++-- sbin/Hourly/DeleteExpiredSessions.pm | 3 +-- sbin/runHourly.pl | 1 + 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/WebGUI/Operation/Statistics.pm b/lib/WebGUI/Operation/Statistics.pm index 3f24f6c83..d95283773 100644 --- a/lib/WebGUI/Operation/Statistics.pm +++ b/lib/WebGUI/Operation/Statistics.pm @@ -59,8 +59,8 @@ sub www_viewActiveSessions { while (%data = $sth->hash) { $row[$i] = ''.$data{username}.' ('.$data{userId}.')'; $row[$i] .= ''.$data{sessionId}.''; - $row[$i] .= ''.epochToHuman($data{expires},"%H:%n%p %M/%D/%y").''; - $row[$i] .= ''.epochToHuman($data{lastPageView},"%H:%n%p %M/%D/%y").''; + $row[$i] .= ''.epochToHuman($data{expires}).''; + $row[$i] .= ''.epochToHuman($data{lastPageView}).''; $row[$i] .= ''.$data{lastIP}.''; $row[$i] .= ''.deleteIcon("op=killSession&sid=$data{sessionId}").''; $i++; diff --git a/sbin/Hourly/DeleteExpiredSessions.pm b/sbin/Hourly/DeleteExpiredSessions.pm index c2d5735fb..646c2a5e1 100644 --- a/sbin/Hourly/DeleteExpiredSessions.pm +++ b/sbin/Hourly/DeleteExpiredSessions.pm @@ -20,10 +20,9 @@ sub process { my $epoch = time(); my $sth = WebGUI::SQL->read("select sessionId from userSession where expires<".$epoch); while (my ($sessionId) = $sth->array) { - WebGUI::SQL->write("delete from userSessionScratch where sessionId=".quote($sessionId)); + WebGUI::Session::end($sessionId); } $sth->finish; - WebGUI::SQL->write("delete from userSession where expires<".$epoch); } 1; diff --git a/sbin/runHourly.pl b/sbin/runHourly.pl index 55632b393..ef40a7f31 100644 --- a/sbin/runHourly.pl +++ b/sbin/runHourly.pl @@ -58,6 +58,7 @@ if (opendir (CONFDIR,$confdir)) { &$cmd(); } } + WebGUI::Session::end($session{var}{sessionId}); WebGUI::Session::close(); } }