summaryrefslogtreecommitdiff
path: root/rt/html/Elements/SetupSessionCookie
diff options
context:
space:
mode:
Diffstat (limited to 'rt/html/Elements/SetupSessionCookie')
-rw-r--r--rt/html/Elements/SetupSessionCookie13
1 files changed, 10 insertions, 3 deletions
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
%# <jesse@bestpractical.com>
%#
%# (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"