Fixed the register user page logging in and setting  variable correctly.