public ActionResult SaveUserTypeCookies(string usertype, string returnUrl) { if (Request.Cookies["User"] != null) { HttpCookie cookie = Request.Cookies["User"]; cookie.Values["UserType"] = usertype; cookie.Expires = DateTime.Now.AddDays(30); Response.SetCookie(cookie); } else { HttpCookie cookie = new HttpCookie("User"); //Need to remove below comment at production deployement // cookie.HttpOnly = true; //cookie.Secure = true; cookie.Values["UserType"] = usertype; cookie.Expires = DateTime.Now.AddDays(30); Response.Cookies.Add(cookie); } // return RedirectToAction("CreateUpsID"); return Redirect(returnUrl); }
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)