diff --git a/security/MemberLoginForm.php b/security/MemberLoginForm.php index 3c81f6904..162bd5857 100644 --- a/security/MemberLoginForm.php +++ b/security/MemberLoginForm.php @@ -135,14 +135,20 @@ JS; */ protected function getMessageFromSession() { parent::getMessageFromSession(); - if(($member = Member::currentUser()) && !Session::get('MemberLoginForm.force_message')) { + + $forceMessage = Session::get('MemberLoginForm.force_message'); + if(($member = Member::currentUser()) && !$forceMessage) { $this->message = _t( 'Member.LOGGEDINAS', "You're logged in as {name}.", array('name' => $member->{$this->loggedInAsField}) ); } - Session::set('MemberLoginForm.force_message', false); + + // Reset forced message + if($forceMessage) { + Session::set('MemberLoginForm.force_message', false); + } }