public ActionResult Index(string id = null, string userMsgRequestIdParam = null)
        {
            FormsAuthenticationTicket ticket = null;

            try
            {
                int userId = 0, latestSessionId = 0;
                _UserDetailsBusinessLogic = new UserDetailsBusinessLogic();
                userMsgRequestId          = userMsgRequestIdParam;

                if (id == null || id == "")
                {
                    System.Web.Security.FormsAuthentication.SignOut();
                    Session.Abandon();
                    HttpCookie authCookie = Request.Cookies[FormsAuthentication.FormsCookieName];

                    if (authCookie.Value != "")
                    {
                        //Before destroying the session cookie
                        // 1.Update the session details to UserSessionLog(Update the LoggedOffTimestamp)
                        // 2.Update the 'IsLoggedIn' flsg of SystemUser as false
                        ticket          = FormsAuthentication.Decrypt(authCookie.Value);
                        userId          = _UserDetailsBusinessLogic.GetUserID(ticket.Name);
                        latestSessionId = _UserDetailsBusinessLogic.GetLatestSessionIdForUser(userId);
                        _UserDetailsBusinessLogic.UpdateUserSessionLog(latestSessionId);
                        _UserDetailsBusinessLogic.UpdateLoggedInStatus(userId, false);

                        authCookie.Expires = DateTime.Now.AddSeconds(-1);
                        Response.Cookies.Add(authCookie);
                    }
                }

                else
                {
                    System.Web.HttpContext.Current.Session["LoginUserType"] = id;
                }

                return(View());
            }
            catch (Exception ex)
            {
                currentFile = this.ControllerContext.RouteData.Values["controller"].ToString(); // System.Diagnostics.StackTrace(true).GetFrame(0).GetFileName();
                StackTrace st = new StackTrace();
                StackFrame sf = st.GetFrame(0);
                methodName = sf.GetMethod().Name;
                ErrorLogHelper.UpdatingErrorLog(currentFile + "-" + methodName, ticket == null ? "N/A" : ticket.Name, ex);

                this.HttpContext.Session["ErrorMsg"] = "PageLoadError";
                return(RedirectToAction("Index", "LoginError"));
            }
        }