コード例 #1
0
ファイル: Cookie.cs プロジェクト: nathan-alden/junior-route
        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);
        }
コード例 #2
0
ファイル: Response.cs プロジェクト: nathan-alden/junior-route
        public Response Cookie(HttpCookie cookie, bool shareable = false)
        {
            cookie.ThrowIfNull("cookie");

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

            return this;
        }