public ActionResult Index(Login login) { try { var Existe = pass.SP_Autoriza(login.Username, login.Password).FirstOrDefault(); Logger.Info("Information on:" + Existe); if (Existe != null) { Session["User"] = login.Username; return(RedirectToAction("Index", "Home")); } else { return(Json(Existe)); } }catch (Exception ex) { Logger.Error("Error On:", ex); Response.StatusCode = 500; Response.StatusDescription = ex.Message; return(Json(Response)); } }