When to use Request.Cookies over Response.Cookies?

后端 未结 6 592
囚心锁ツ
囚心锁ツ 2020-12-02 07:30

Do I use response when at a page event (e.g. load) as this is a response from ASP.NET, and request when pressing a button as this is a response going to ASP.NET for processi

6条回答
  •  忘掉有多难
    2020-12-02 08:01

    In a web application the request is what comes from the browser and the response is what the server sends back. When validating cookies or cookie data from the browser you should use the Request.Cookies. When you are constructing cookies to be sent to the browser you need to add them to Response.Cookies.

提交回复
热议问题