Пример #1
0
        public void RemoveCookie_ShouldResetCookieValue()
        {
            _cookieHandler.SetCookieValue("foo", "bar");
            _cookieHandler.InvalidateCookie("foo");

            var value = _cookieHandler.GetCookieValue("foo");

            Assert.That(value, Is.EqualTo(string.Empty));
        }
Пример #2
0
        public void InvalidateCookie(string cookieName)
        {
            if (_httpContext == null || _httpContext.Request == null || _httpContext.Request.Url == null)
            {
                return;
            }

            if (_domainHost != _httpContext.Request.Url.Host)
            {
                return;
            }

            _cookieHandler.InvalidateCookie(cookieName);
        }