// Token: 0x06000151 RID: 337 RVA: 0x0000A1A0 File Offset: 0x000083A0
 internal static void UpdateCookie(HttpContext httpContext, string action, DateTime checkPointDateTime)
 {
     try
     {
         if (LogonLatencyLogger.loggingEnabled)
         {
             DateTime utcNow  = DateTime.UtcNow;
             long     latency = Convert.ToInt64((utcNow - checkPointDateTime).TotalMilliseconds);
             if (action.Equals("ADL"))
             {
                 LogonLatencyLogger.AddLatencyHeader(httpContext, "X-AuthDiagInfoLdapLatency", latency);
             }
             else
             {
                 LogonLatencyLogger.AddLatencyHeader(httpContext, "X-AuthDiagInfoMservLookupLatency", latency);
             }
             string text        = string.Empty;
             string cookieValue = string.Empty;
             if (httpContext.Request.Cookies["logonLatency"] != null && httpContext.Request.Cookies["logonLatency"].Value != null)
             {
                 text = LogonLatencyLogger.GetLatestCookieValue(httpContext);
                 if (action.Equals("ADL") || action.Equals("MSERVL"))
                 {
                     int num = 1;
                     if (!string.IsNullOrEmpty(text))
                     {
                         while (text.Contains(action + num))
                         {
                             num++;
                         }
                     }
                     action += num;
                 }
                 cookieValue = string.Format("{0}&{1}={2}", text, action, latency.ToString());
                 LogonLatencyLogger.SetCookie(httpContext, "logonLatency", cookieValue, Utilities.GetOutlookDotComDomain(httpContext.Request.GetRequestUrlEvenIfProxied().Host));
             }
             else
             {
                 string arg = "adlkupltncy";
                 if (action.Equals("MSERVL"))
                 {
                     arg = "mservlkupltncy";
                 }
                 httpContext.Response.AppendToLog(string.Format("&{0}={1}", arg, latency.ToString()));
             }
         }
     }
     catch (Exception ex)
     {
         ExTraceGlobals.LiveIdAuthenticationModuleTracer.TraceError <string, string>(0L, "Unexpected exception while updating logon latency cookie. Exception message: {0}. Stack trace: {1}", ex.Message, ex.StackTrace);
     }
 }
 // Token: 0x06000153 RID: 339 RVA: 0x0000A424 File Offset: 0x00008624
 internal static void WriteLatencyToIISLogAndDeleteCookie(HttpContext httpContext)
 {
     try
     {
         if (LogonLatencyLogger.loggingEnabled)
         {
             long num  = -1L;
             long num2 = -1L;
             NameValueCollection nameValueCollection = new NameValueCollection();
             StringBuilder       stringBuilder       = new StringBuilder();
             if (httpContext.Request.Cookies["logonLatency"] != null && httpContext.Request.Cookies["logonLatency"].Value != null)
             {
                 nameValueCollection          = HttpUtility.ParseQueryString(LogonLatencyLogger.GetLatestCookieValue(httpContext));
                 nameValueCollection["LGN04"] = DateTime.UtcNow.Ticks.ToString();
                 LogonLatencyLogger.AssignLatency(nameValueCollection, "LGN02", "LGN01", ref num);
                 LogonLatencyLogger.AssignLatency(nameValueCollection, "LGN04", "LGN02", ref num2);
                 stringBuilder.AppendFormat("&livelgnltncy={0}&resubrpsltncy={1}", num.ToString(), num2.ToString());
                 for (int i = 1; i <= 5; i++)
                 {
                     if (nameValueCollection["ADL" + i] != null)
                     {
                         stringBuilder.AppendFormat("&adlkupltncy{0}={1}", i, nameValueCollection["ADL" + i]);
                     }
                 }
                 for (int j = 1; j <= 3; j++)
                 {
                     if (nameValueCollection["MSERVL" + j] != null)
                     {
                         stringBuilder.AppendFormat("&mservlkupltncy{0}={1}", j, nameValueCollection["MSERVL" + j]);
                     }
                 }
             }
             if (!stringBuilder.ToString().Contains("adlkupltncy1"))
             {
                 stringBuilder.AppendFormat("&adlkupltncy1=-1", new object[0]);
             }
             httpContext.Response.AppendToLog(stringBuilder.ToString());
             httpContext.Items["logonLatency"] = stringBuilder.ToString();
             LogonLatencyLogger.DeleteCookie(httpContext);
         }
     }
     catch (Exception ex)
     {
         ExTraceGlobals.LiveIdAuthenticationModuleTracer.TraceError <string, string>(0L, "Unexpected exception while writing logon latency to IIS. Exception message: {0}. Stack trace: {1}", ex.Message, ex.StackTrace);
     }
 }
 // Token: 0x06000152 RID: 338 RVA: 0x0000A34C File Offset: 0x0000854C
 internal static void UpdateCookie(HttpContext httpContext, string logonStep)
 {
     try
     {
         if (LogonLatencyLogger.loggingEnabled)
         {
             string arg         = string.Empty;
             string cookieValue = string.Empty;
             if (httpContext.Request.Cookies["logonLatency"] != null && httpContext.Request.Cookies["logonLatency"].Value != null)
             {
                 arg         = LogonLatencyLogger.GetLatestCookieValue(httpContext);
                 cookieValue = string.Format("{0}&{1}={2}", arg, logonStep, DateTime.UtcNow.Ticks.ToString());
                 LogonLatencyLogger.SetCookie(httpContext, "logonLatency", cookieValue, Utilities.GetOutlookDotComDomain(httpContext.Request.GetRequestUrlEvenIfProxied().Host));
             }
         }
     }
     catch (Exception ex)
     {
         ExTraceGlobals.LiveIdAuthenticationModuleTracer.TraceError <string, string>(0L, "Unexpected exception while updating logon latency cookie. Exception message: {0}. Stack trace: {1}", ex.Message, ex.StackTrace);
     }
 }