public ActionResult SetTerminal(string[] terminal) { HttpContext.SetCourseListToNullCookie("FrontOfficeTerminal"); var pcs = (terminal ?? new string[0]) .SelectMany(p => p.Split(new[] { ',' }, StringSplitOptions.RemoveEmptyEntries)).ToArray(); HttpContext.AmendCourseListCookie(ActionType.Add, pcs, "FrontOfficeTerminal"); return(Json(new { name = "House Keeping && Laundry", id = GetTerminalId(terminal.FirstOrDefault()), }, JsonRequestBehavior.AllowGet)); }