Why is a cookie available in a request right after setting with a response?

In pageload, if you execute Response.Cookies.Add (..., right on the next line, you can access this cookie via Request.Cookies (...

I know that under cookies the cookie is added to Request.Cookies.net, but the original request never had this cookie.

If I say correctly, why so? Should the cookie be stored at the next request? Should you immediately access Request.Cookies (... be null?

+5
source share
1 answer

You are right, ASP.NET does this behind the scenes:

cookie HttpResponse.Cookies, cookie HttpRequest.Cookies, .

- HttpRequest.Cookies MSDN

? , , .

+6

All Articles