dotnet / dotnet/aspnetcore

Empty cookies are missing from HttpRequest.Cookies

Open
#52,580 6 comments 3 reactions 0 assignees View on GitHub
area-networking
Dominant language
C#
Stars
38.4k
Forks
10.9k
Avg merge
2d 6h
Merged PRs (30d)
290

Description

### Is there an existing issue for this?

- [X] I have searched the existing issues

### Describe the bug

When a browser makes a request with a cookie that has an empty value, the cookie does not exist in `HttpRequest.Cookies`. I can always fish the cookie name/existence out of `HttpRequest.Headers`, of course, but that's not very nice.

### Expected Behavior

RFC 6265 permits `cookie-value` to be empty, so I'd expect the cookie to exist with an empty value in `HttpRequest.Cookies`.

### Steps To Reproduce

_No response_

### Exceptions (if any)

_No response_

### .NET Version

8.0.100

### Anything else?

ASP.NET Core 8.0.0

(Originally reported [here](https://github.com/dotnet/aspnetcore/issues/52159#issuecomment-1819426428).)

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.