Ejemplo n.º 1
0
 public static void SetCookie(this IWebHttpResponseCookie Cookie, string Name, WebHttpCookieValue Value)
 {
     if (Cookie.Exist(Name))
     {
         Cookie.Clear(false);
         var list = new List <WebHttpCookieValue>(1);
         list.Add(Value);
         Cookie[Name] = list;
     }
     else
     {
         Cookie.Add(Name, Value);
     }
 }
Ejemplo n.º 2
0
        public static WebHttpCookieValue GetCookie(this IWebHttpResponseCookie Cookie, string Name, WebHttpCookieValue Default = null)
        {
            var cookie = GetCookies(Cookie, Name, null);

            return(cookie == null ? Default : cookie[0]);
        }
Ejemplo n.º 3
0
 public static WebHttpCookieValue GetCookie(this IWebHttpResponse Response, string Name, WebHttpCookieValue Default = null) => WebUtils.GetCookie(Response.Cookies, Name, Default);