Ejemplo n.º 1
0
		public void createSessionUserLogin(LoginViewModel.userLogin lvm)
		{
			System.Web.HttpContext.Current.Session["sessionUserLogin"] = lvm;
			System.Web.HttpContext.Current.Session.Timeout = 30;//minutes
		}
Ejemplo n.º 2
0
		public ActionResult Login(LoginViewModel model, string returnUrl)
		{
			if (ModelState.IsValid)
			{
				if (Authenticate(model.UserID, model.Password))
				{
					FormsAuthentication.SetAuthCookie(model.UserID, false);
					return Redirect(returnUrl ?? Url.Action("Index", "Account"));
				}
				else
				{
					ModelState.AddModelError("", "Incorect UserID Or Password");
					return View();
				}
			}
			else
			{
				return View();
			}
		}