/// <summary>
        /// Returns the location identifier for this HttpRequest context. Response cookies are searched first
        /// and if no cookie is found then Requeset cookies are searched for location identifier.
        /// If there isno cookie in Request or Response then the Location Identifier in the SessionId id returned.
        /// </summary>
        /// <param name="context">Context of current HttpRequest</param>
        /// <param name="sessionId">SessionId for the Request</param>
        /// <returns>Location Identifer if cookie is found other wise the sessionId is returned.</returns>
        private string GetLocationID(IAspEnvironmentContext context, string sessionId)
        {
            string locationID = sessionId;

            if (_isLocationAffinityEnabled)
            {
                if (!string.IsNullOrEmpty(locationID = context.GetLocationCookie()))
                {
                    return(locationID);
                }

                return(sessionId);
            }
            return(locationID);
        }
Exemple #2
0
 private bool IsSessionCookieless(IAspEnvironmentContext context)
 {
     if (_isLocationAffinityEnabled)
     {
         try
         {
             if (!string.IsNullOrEmpty(context.GetLocationCookie()))
             {
                 return(false);
             }
         }
         catch (Exception e)
         {
             if (NCacheLog != null)
             {
                 LogError(e.ToString(), null);
             }
         }
     }
     return(true);
 }