} else { // Need access -- name (id), email. Give server access? $logged_in = true; if ($redirect_to_home !== true && empty($redirect_url)) { $durl = $self_url; } else { if ($redirect_to_home === true) { $durl = $baseurl; } else { $durl = $redirect_url; } } if (isset($_COOKIE[$cookieuser]) || $logged_in === true) { $cookiedebug .= " cookie-enter"; // Cookies are set $result = $user->lookupItem($_COOKIE[$cookieuser], 'username'); if ($result !== false) { // good user // Check auth $cookiedebug .= 'good-user check-auth ' . print_r($_COOKIE[$cookieuser], true); $userdata = mysqli_fetch_assoc($result); $pw_characters = json_decode($userdata['password'], true); // pieces: $salt = $cookie_result['source'][1]; $otsalt = $cookie_result['source'][2]; $cookie_secret = $cookie_result['source'][0]; // won't grab new data until refresh, use passed $current_ip = $_SERVER['REMOTE_ADDR']; $ipArray = explode(".", $current_ip); array_pop($ipArray); $ipTop = implode(".", $ipArray);