X-Git-Url: http://git.freeside.biz/gitweb/?p=freeside.git;a=blobdiff_plain;f=rt%2Fhtml%2FElements%2FSetupSessionCookie;h=3225c0d8c502cc4f6157991225b625aaddc64f80;hp=63101af5a7195c7e2e3d116a12f811f92046811c;hb=75162bb14b3e38d66617077843f4dfdcaf09d5c4;hpb=8103c1fc1b2c27a6855feadf26f91b980a54bc52 diff --git a/rt/html/Elements/SetupSessionCookie b/rt/html/Elements/SetupSessionCookie index 63101af5a..3225c0d8c 100644 --- a/rt/html/Elements/SetupSessionCookie +++ b/rt/html/Elements/SetupSessionCookie @@ -2,7 +2,7 @@ %# %# COPYRIGHT: %# -%# This software is Copyright (c) 1996-2007 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2009 Best Practical Solutions, LLC %# %# %# (Except where explicitly superseded by other copyright notices) @@ -24,7 +24,7 @@ %# along with this program; if not, write to the Free Software %# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA %# 02110-1301 or visit their web page on the internet at -%# http://www.gnu.org/copyleft/gpl.html. +%# http://www.gnu.org/licenses/old-licenses/gpl-2.0.html. %# %# %# CONTRIBUTION SUBMISSION POLICY: @@ -50,7 +50,7 @@ return if $m->is_subrequest; # avoid reentrancy, as suggested by masonbook my %cookies = CGI::Cookie->fetch(); my $cookiename = "RT_SID_" . $RT::rtname . "." . $ENV{'SERVER_PORT'}; -$SessionCookie ||= $cookies{$cookiename} ? $cookies{$cookiename}->value : undef; +$SessionCookie = $cookies{$cookiename} ? $cookies{$cookiename}->value : undef; my %backends = ( mysql => 'Apache::Session::MySQL', @@ -97,6 +97,13 @@ if ($@) { undef $cookies{$cookiename}; }; } +elsif ( !($session{'CurrentUser'} && $session{'CurrentUser'}->id) ) { + eval { + undef $cookies{$cookiename}; + tied(%session)->delete; + tie %session, $session_class, undef, $session_properties; + } +} if ($@) { die loc("RT couldn't store your session.") . "\n"