Esempio n. 1
0
        /// <inheritdoc cref="Set(System.Net.CookieCollection)"/>
        /// <param name="uri">Uri куки</param>
        /// <param name="rawCookie">Сырой формат записи в виде строки</param>
        public void Set(Uri uri, string rawCookie)
        {
            string filteredCookie = CookieFilters.Filter(rawCookie);

            if (ExpireBeforeSet)
            {
                int equalIndex = filteredCookie.IndexOf('=');
                if (equalIndex != -1)
                {
                    string cookieName = filteredCookie.Substring(0, equalIndex + 1);
                    ExpireIfExists(uri, cookieName);
                }
            }

            Container.SetCookies(uri, filteredCookie);
        }
Esempio n. 2
0
        /// <inheritdoc cref="Set(System.Net.CookieCollection)"/>
        /// <param name="uri">Uri куки</param>
        /// <param name="rawCookie">Сырой формат записи в виде строки</param>
        public void Set(Uri uri, string rawCookie)
        {
            string filteredCookie = CookieFilters.Filter(rawCookie);

            Container.SetCookies(uri, filteredCookie);
        }