// Token: 0x06000793 RID: 1939 RVA: 0x0001834C File Offset: 0x0001654C
        internal static UserContextCookie GetUserContextCookie(HttpContext httpContext)
        {
            HttpRequest request = httpContext.Request;

            for (int i = 0; i < request.Cookies.Count; i++)
            {
                HttpCookie httpCookie = request.Cookies[i];
                if (httpCookie.Name != null && httpCookie.Name.StartsWith(UserContextCookie.UserContextCookiePrefix, StringComparison.OrdinalIgnoreCase))
                {
                    UserContextCookie userContextCookie = UserContextCookie.TryCreateFromHttpCookie(httpCookie);
                    if (userContextCookie == null)
                    {
                        ExTraceGlobals.UserContextTracer.TraceDebug <string, string, string>(0L, "Invalid user context cookie received. Name={0}, Value={1}, httpContext.Request.RawUrl={2}", httpCookie.Name, httpCookie.Value, request.RawUrl);
                        return(null);
                    }
                    if (userContextCookie.MailboxUniqueKey == null)
                    {
                        if (!UserContextUtilities.IsDifferentMailbox(httpContext))
                        {
                            return(userContextCookie);
                        }
                    }
                    else
                    {
                        string explicitLogonUser = UserContextUtilities.GetExplicitLogonUser(httpContext);
                        if (!string.IsNullOrEmpty(explicitLogonUser))
                        {
                            using (OwaIdentity owaIdentity = OwaIdentity.CreateOwaIdentityFromExplicitLogonAddress(explicitLogonUser))
                            {
                                if (string.Equals(userContextCookie.MailboxUniqueKey, owaIdentity.UniqueId, StringComparison.Ordinal))
                                {
                                    return(userContextCookie);
                                }
                            }
                        }
                    }
                }
            }
            return(null);
        }