예제 #1
0
        internal void AddCookie(HttpCookie cookie, bool append)
        {
            if (cookie == null)
                throw new ArgumentNullException("cookie");

            _allKeys = null;

            if (append)
                BaseAdd(cookie.Name, cookie);
            else
                BaseSet(cookie.Name, cookie);
        }
예제 #2
0
        public HttpCookie Get(string name)
        {
            var result = (HttpCookie)BaseGet(name);

            if (result == null)
            {
                result = new HttpCookie(name);

                AddCookie(result, true);
            }

            return result;
        }
예제 #3
0
 public void Set(HttpCookie cookie)
 {
     AddCookie(cookie, false);
 }
예제 #4
0
 public void Add(HttpCookie cookie)
 {
     AddCookie(cookie, true);
 }