public function setPassword($password)
    {
        if(!$this->isValidPassword($password)){
            return false;
        }

        if ($this->setPasswordStatement === null) {
            $this->setPasswordStatement = $this->connection->prepare("UPDATE User SET password=? WHERE username=?");
            $this->setPasswordStatement->bindParam(1, $this->password);
            $this->setPasswordStatement->bindParam(2, $this->username);
        }
        $wasLoggedIn = $this->isLoggedIn();
        $this->password = $this->hashPassword($password);
        $this->setPasswordStatement->execute();

        if ($wasLoggedIn) {

            $this->updateLoginSession();
        }

        return true;
    }