Changed loggedin to loggedIn in saveLoginCookie