From: berick Date: Thu, 7 Apr 2011 18:22:48 +0000 (-0400) Subject: after clearing out a stale ses cookie, return user to originally requested resource... X-Git-Tag: sprint4-merge-nov22~5128^2~72^2~120^2~3 X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=d131cb1e0bc4d42612854195a9e77cee607d50f5;p=working%2FEvergreen.git after clearing out a stale ses cookie, return user to originally requested resource instead directing home. this prevents the case where going to 'my account' in presence of expired ses cookie redirects the user home --- diff --git a/Open-ILS/src/perlmods/lib/OpenILS/WWW/EGCatLoader.pm b/Open-ILS/src/perlmods/lib/OpenILS/WWW/EGCatLoader.pm index fbb61ac57c..9ba54a71ad 100644 --- a/Open-ILS/src/perlmods/lib/OpenILS/WWW/EGCatLoader.pm +++ b/Open-ILS/src/perlmods/lib/OpenILS/WWW/EGCatLoader.pm @@ -201,8 +201,10 @@ sub load_common { } else { - # authtoken is no longer valid, log out to clean up - return $self->load_logout; + # if we encounter a stale authtoken, call load_logout + # to clean up the cookie, then redirect the user to the + # originally requested page + return $self->load_logout($self->apache->unparsed_uri); } } @@ -274,13 +276,14 @@ sub load_login { # ----------------------------------------------------------------------------- sub load_logout { my $self = shift; + my $redirect_to = shift; # If the user was adding anyting to an anonymous cache # while logged in, go ahead and clear it out. $self->clear_anon_cache; return $self->generic_redirect( - $self->ctx->{home_page}, + $redirect_to || $self->ctx->{home_page}, $self->cgi->cookie( -name => COOKIE_SES, -path => '/',