Updated class to allow for login success check

$loggedin ($this->loggedin) field added to the class to allow a boolean check after login.