bool SetCookie(string header)
        {
            if (cookieCollection == null)
            {
                cookieCollection = new CookieCollection();
            }

            bool at_least_one_set = false;
            var  parser           = new CookieParser(header);

            foreach (var cookie in parser.Parse())
            {
                if (cookie.Domain == "")
                {
                    cookie.Domain    = uri.Host;
                    cookie.HasDomain = false;
                }

                if (cookie.HasDomain &&
                    !CookieContainer.CheckSameOrigin(uri, cookie.Domain))
                {
                    continue;
                }

                cookieCollection.Add(cookie);
                if (cookie_container != null)
                {
                    cookie_container.Add(uri, cookie);
                    at_least_one_set = true;
                }
            }

            return(at_least_one_set);
        }
Beispiel #2
0
        void SetCookie(string header)
        {
            if (cookieCollection == null)
            {
                cookieCollection = new CookieCollection();
            }

            var parser = new CookieParser(header);

            foreach (var cookie in parser.Parse())
            {
                if (cookie.Domain == "")
                {
                    cookie.Domain      = uri.Host;
                    cookie.ExactDomain = true;
                }

                if (!CookieContainer.CheckSameOrigin(uri, cookie.Domain))
                {
                    continue;
                }

                cookieCollection.Add(cookie);
                if (cookie_container != null)
                {
                    cookie_container.Add(uri, cookie);
                }
            }
        }
Beispiel #3
0
        void SetCookie(string header)
        {
            if (cookieCollection == null)
            {
                cookieCollection = new CookieCollection();
            }

            var parser = new CookieParser(header);

            foreach (var cookie in parser.Parse())
            {
                if (cookie.Domain == "")
                {
                    cookie.Domain = uri.Host;
                }

                cookieCollection.Add(cookie);
                if (cookie_container != null)
                {
                    cookie_container.Add(uri, cookie);
                }
            }
        }
Beispiel #4
0
		void SetCookie (string header)
		{
			if (cookieCollection == null)
				cookieCollection = new CookieCollection ();

			var parser = new CookieParser (header);
			foreach (var cookie in parser.Parse ()) {
				if (cookie.Domain == "")
					cookie.Domain = uri.Host;

				cookieCollection.Add (cookie);
				if (cookie_container != null)
					cookie_container.Add (uri, cookie);
			}
		}
Beispiel #5
0
		void SetCookie (string header)
		{
			if (cookieCollection == null)
				cookieCollection = new CookieCollection ();

			var parser = new CookieParser (header);
			foreach (var cookie in parser.Parse ()) {
				if (cookie.Domain == "") {
					cookie.Domain = uri.Host;
					cookie.HasDomain = false;
				}

				if (cookie.HasDomain &&
				    !CookieContainer.CheckSameOrigin (uri, cookie.Domain))
					continue;

				cookieCollection.Add (cookie);
				if (cookie_container != null)
					cookie_container.Add (uri, cookie);
			}
		}