public function loginView()
 {
     // If user submit login. Then log in.
     if ($this->loginView->userSubmit()) {
         // Retrieve username and password string from LoginView from user post.
         $password = $this->loginView->GetPassword();
         $username = $this->loginView->GetUsername();
         $trueAgent = $this->loginView->GetAgent();
         // Check userModel if user can log in.
         if ($this->loginModel->LogIn($username, $password, $trueAgent)) {
             // Create cookie if user clicked select box in login view.
             $this->sessionModel->SetUser($username);
             if ($this->loginView->wantCookie()) {
                 $this->setCookie();
                 NavView::redirectToUMLMSG($username);
             }
             NavView::redirectToUMLMSG($username);
         } else {
             $this->loginView->FailedMSG($username, $password);
         }
     }
     return $this->loginView->show();
 }