internal static IsolatedCookieContainer Create(string id) { var d = isolatedCookieContainerIds.TryGetNullableValue(id).GetValueOrDefault(); d++; isolatedCookieContainerIds[id] = d; if (d != 1) { id += "?" + d; } var isolatedCookies = new IsolatedCookieContainer(); isolatedCookies.CacheVaryKey = id; var p = isolatedCookies.GetCachePath(); if (p != null) { var f = Caching.TryReadCacheFile(p); if (f != null) { isolatedCookies._cookies = f.Cookies; isolatedCookies.LastPersistedCookies = f.Cookies.ToDictionary(x => x.Key, x => x.Value); } } return(isolatedCookies); }
internal static IsolatedCookieContainer Create(string id) { var d = isolatedCookieContainerIds.TryGetNullableValue(id).GetValueOrDefault(); d++; isolatedCookieContainerIds[id] = d; if (d != 1) { id += "?" + d; } var isolatedCookies = new IsolatedCookieContainer(); isolatedCookies.CacheVaryKey = id; var p = isolatedCookies.GetCachePath(); if (p != null) { var f = Caching.TryReadCacheFile(p); if (f != null) { isolatedCookies._cookies = f.Cookies; isolatedCookies.LastPersistedCookies = f.Cookies.ToDictionary(x => x.Key, x => x.Value); } } return isolatedCookies; }