Exemplo n.º 1
0
        public Response Cookie(HttpCookie cookie, bool shareable = false)
        {
            cookie.ThrowIfNull("cookie");

            _cookies.Add(new Cookie(cookie, shareable));

            return(this);
        }
Exemplo n.º 2
0
        public Cookie(HttpCookie cookie, bool shareable = false)
        {
            cookie.ThrowIfNull("cookie");

            _name      = cookie.Name;
            _path      = cookie.Path;
            _secure    = cookie.Secure;
            _shareable = shareable;
            _httpOnly  = cookie.HttpOnly;
            _domain    = cookie.Domain;
            _expires   = cookie.Expires;
            _value     = cookie.Value;

            IEnumerable <CookieValue> cookieValues = cookie.Values.AllKeys
                                                     .Where(arg => arg != null)
                                                     .Select(arg => new CookieValue(arg, cookie.Values[arg]));

            _values.AddRange(cookieValues);
        }