Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Why are request cookie poperties null or incorrect on ASP.NET postback?

I'm debugging the HttpContext.Current.Request.Cookie values in an ASP.NET web application, and finding the only property correctly populated is the Value. The Domain and Path are null, and the Expires value is set to DateTime.Min.

like image 710
Jim Straatman Avatar asked Jan 26 '09 20:01

Jim Straatman


1 Answers

Those values are not available in the Request.Cookies collecton. They are only used when you are "setting" the value. You can verify this with a network trace. In the request headers, the client browser only sends the name/value pairs in the "Cookie" header.

like image 74
David Avatar answered Nov 05 '22 21:11

David