With further examination, I've found that line 1267:
header(sprintf("Location: %s", $_SERVER['REQUEST_URI']));is responsible for the variable loss. The reason? I have no idea. But with that line taken out, everything seems to work fine. Now, I did not delete that line from the file itself, but rather copied the function to my custom do_login.php. Then I replaced all of the $this variables to $html, since I removed the function from the 'html' class.