From 0b38f1c58b822ac1ec5a199de00f0a0631c01a61 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Roland=20H=C3=A4der?= <Quix0r@users.noreply.github.com>
Date: Thu, 19 Jul 2018 13:11:03 +0200
Subject: [PATCH] Fixes applied: (#5399)
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

- $_SESSION['remember_user'] did only exist here and no where else
- it seems to be accient old-lost code, so I fixed it to $a->user['nickname']
  instead
- used multi-line comment for multiple lines of on-line comments

Signed-off-by: Roland Häder <roland@mxchange.org>
---
 include/security.php | 12 +++++++-----
 1 file changed, 7 insertions(+), 5 deletions(-)

diff --git a/include/security.php b/include/security.php
index 9cff670787..768d7c82d4 100644
--- a/include/security.php
+++ b/include/security.php
@@ -171,12 +171,14 @@ function authenticate_success($user_record, $login_initial = false, $interactive
 	}
 
 	if ($login_initial) {
-		// If the user specified to remember the authentication, then set a cookie
-		// that expires after one week (the default is when the browser is closed).
-		// The cookie will be renewed automatically.
-		// The week ensures that sessions will expire after some inactivity.
+		/*
+		 * If the user specified to remember the authentication, then set a cookie
+		 * that expires after one week (the default is when the browser is closed).
+		 * The cookie will be renewed automatically.
+		 * The week ensures that sessions will expire after some inactivity.
+		 */
 		if ($_SESSION['remember']) {
-			logger('Injecting cookie for remembered user ' . $_SESSION['remember_user']['nickname']);
+			logger('Injecting cookie for remembered user ' . $a->user['nickname']);
 			new_cookie(604800, $user_record);
 			unset($_SESSION['remember']);
 		}