private void checkCookieExistence(string cookie) { if (cookie == "") { var cookiesList = PreventiveMaintenanceManager.AuthenticateMaximo(); if (cookiesList != null) { var cookieObj = PreventiveMaintenanceManager.setCookie(cookiesList[0].Name, cookiesList[0].Value, 30); Response.Cookies.Add(cookieObj); } } }
// GET: PrimeTPrime #region Prime_TPrime_Ticketing public ActionResult Index() { if (User.Identity.HasPermission("perm_prime_tprime_open") || User.Identity.HasPermission("perm_prime_tprime_view")) { ViewBag.PrimeTPrimePermissions = User.Identity.GetPermissionsList(); var checkCookieExistance = PreventiveMaintenanceManager.getCookie("LtpaToken2", "LtpaToken2"); if (checkCookieExistance == "") { var cookiesList = PreventiveMaintenanceManager.AuthenticateMaximo(); if (cookiesList != null) { var cookieObj = PreventiveMaintenanceManager.setCookie(cookiesList[0].Name, cookiesList[0].Value, 30); Response.Cookies.Add(cookieObj); } } return(View()); } else { return(RedirectToAction("Index", "Dashboard")); } }