Quantcast
Channel: ASPNETWebStack Issue Tracker Rss Feed
Viewing all articles
Browse latest Browse all 7215

Created Issue: A badly formatted cookie causes GetCookies to return 0 cookies [594]

$
0
0
If a request includes a cookie with whitespace in it's name, GetCookies will return 0 cookies.

The attached fiddler sessions demonstrate the issue. Below is the implementation of the method that was called.

In the initial request the cookie header is:

Cookie: c1=v1; c2=v2; c3=v3;

This returns a count of 3

In the second request the cookie header is:

Cookie: c1=v1; c2=v2; c3=v3; bad cookie=trouble;

This returns a count of 0

[HttpGet]
public HttpResponseMessage CountCookies()
{
return Request.CreateResponse(HttpStatusCode.OK, new {CookieCount = Request.Headers.GetCookies().Sum(x => x.Cookies.Count)});
}

Viewing all articles
Browse latest Browse all 7215

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>